dsp/autoupdate
2017-09-25 09:03:47 -07:00

25 lines
517 B
Bash
Executable file

#!/usr/bin/env zsh
set -e
[ -d lib ] && rm -r lib
dropbox_uploader -q download py/lib >/dev/null
mv lib/README.md .
if [ ! -d .git ]; then
git -q init
git add .gitignore '*' '**/*'
else
git add -A
changes="$(git status --porcelain | wc -l)"
[ "$changes" -eq 0 ] && exit 0
fi
version="$(git log --oneline | wc -l)"
let version++ || true # -e mode doesn't like this normally
git commit -qm "update $version" . >/dev/null
if git remote | grep -Fxq origin; then
git push -q origin master
fi