diff --git a/README.md b/README.md index 112b276a0a6830d2b7c3eb89f6c14bd44556ce1c..88cff5014d23a0e4924e4c8732af729d5c8407a3 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,17 @@ content: toplevel=$(git rev-parse --show-toplevel) f=${toplevel}/VERSION -touch $f + +if [ ! -f "$f" ]; then + touch "$f" + git add "$f" 2>/dev/null +fi + old_version=$(cat $f) new_version=$(git describe --tags --abbrev=0) if [ "$old_version" != "$new_version" ]; then - echo "$new_version" > $f + echo "$new_version" > "$f" git commit -am "update version to '"$new_version"'" git push origin # Is required because normal push does not necessarily happen fi