]> Sergey Matveev's repositories - feeder.git/blobdiff - cmd/parse.sh
Various refactoring and parametrizing
[feeder.git] / cmd / parse.sh
index b1e4a0268b90843892e7aad5a0fd6c1dd8c49fdd..5b598932a1c12fb77015fe001b8fe889a94c199d 100755 (executable)
@@ -1,11 +1,12 @@
 #!/bin/sh -e
 
 cmds="$(dirname "$(realpath -- "$0")")"
+. "$cmds/env.rc"
 cd "$1"
-[ -s parse.hash ] && hash_our=`cat parse.hash` || :
-[ -s download.hash ] && hash_their=`cat download.hash` || :
+[ -s parse.hash ] && hash_our="`cat parse.hash`" || :
+[ -s download.hash ] && hash_their="`cat download.hash`" || :
 [ "$hash_our" != "$hash_their" ] || exit 0
-[ -s max ] && max=`cat max` || max=${FEEDER_MAX_ITEMS:-100}
-zstd -d < feed.zst | $cmds/feed2mdir/feed2mdir -max-entries $max . > title.tmp
+[ -s max ] && max=`cat max` || max=$FEEDER_MAX_ITEMS
+$ZSTD -d < feed.zst | $cmds/feed2mdir/feed2mdir -max-entries $max . > title.tmp
 mv title.tmp title
-echo $hash_their > parse.hash
+echo "$hash_their" > parse.hash