better upload script

This commit is contained in:
/dev/urandom 2020-08-18 16:36:12 +03:00
parent cd1f95721a
commit 83f3cd83bb
3 changed files with 3 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
localhashes.txt
remotehashes.txt
Makefile.cfg Makefile.cfg
upload.pwd upload.pwd
upload.lasttime upload.lasttime

BIN
static/neocities.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -74,7 +74,7 @@ else
echo $FILELIST | jq -cr '.files[]|select(.is_directory == false)|[.sha1_hash,.path] | @tsv' | sed 's/\t/ /' | sort -k2 > remotehashes.txt echo $FILELIST | jq -cr '.files[]|select(.is_directory == false)|[.sha1_hash,.path] | @tsv' | sed 's/\t/ /' | sort -k2 > remotehashes.txt
( cd out; find -name '[!.]*' * -type f -exec sha1sum {} + | sort -k2 ) > localhashes.txt ( cd out; find . -name '[!.]*' -type f -exec sha1sum {} + | sort -k2 | sed 's/ \.\// /' ) > localhashes.txt
UPDFILES=`diff -U0 localhashes.txt remotehashes.txt | grep ^-[0-9a-f] | cut -d " " -f3` UPDFILES=`diff -U0 localhashes.txt remotehashes.txt | grep ^-[0-9a-f] | cut -d " " -f3`