2017-03-12 08:31:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Hacky little helper called from edit/ and sandbox/ apps to save a snapshot
|
|
|
|
# of lesson/ using git.
|
2018-02-20 09:36:02 +00:00
|
|
|
set -e
|
2017-03-12 08:31:55 +00:00
|
|
|
|
|
|
|
test -d lesson/.git || exit 0 # give up if it's not a git repo
|
|
|
|
|
|
|
|
cd lesson
|
|
|
|
# explicitly say '--all' for git 1.9
|
|
|
|
git add --all .
|
|
|
|
# bug in git: git diff -q messes up --exit-code
|
|
|
|
git diff HEAD --exit-code >/dev/null || git commit -a -m . >/dev/null
|