X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fwarcs;fp=cmd%2Fwarcs;h=7934b63c2182230168870bedaf17f01ae4d127cb;hb=6cc50db0fc224e9053501342658b26ca87968507;hp=2f662abe2df420a7534a9bd2ff5137db8f6c3ca5;hpb=17a8353503e522ba3f520ec6452a5ebb5966f2f6;p=feeder.git diff --git a/cmd/warcs b/cmd/warcs index 2f662ab..7934b63 100755 --- a/cmd/warcs +++ b/cmd/warcs @@ -1,15 +1,14 @@ #!/usr/bin/env zsh -set -e +setopt ERR_EXIT EXTENDED_GLOB cmds=$0:h:a . $cmds/env.rc fpath=($cmds/functions.zsh $fpath) dst=$2:a cd $1 -[[ -n "$dst" ]] || { dst=warcs ; dst=$dst:a } +[[ -n $dst ]] || { dst=warcs ; dst=$dst:a } mkdir -p $dst autoload url-to-filename zmodload -F zsh/datetime b:strftime -setopt EXTENDED_GLOB wget_opts=( --user-agent="$FEEDER_USER_AGENT" --page-requisites @@ -20,7 +19,7 @@ wget_opts=( ) for new (new/*(N)) { while read line ; do - [[ "$line" != "" ]] || break + [[ -n $line ]] || break cols=(${(s: :)line}) [[ $cols[1] = "X-URL:" ]] || continue url=$cols[2]