release 760 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. set -euo pipefail
  3. IFS=$'\n\t'
  4. err=0
  5. # Disallow unstaged changes in the working tree
  6. if ! git diff-files --quiet --ignore-submodules --
  7. then
  8. echo >&2 "cannot $0: you have unstaged changes."
  9. git diff-files --name-status -r --ignore-submodules -- >&2
  10. err=1
  11. fi
  12. # Disallow uncommitted changes in the index
  13. if ! git diff-index --cached --quiet HEAD --ignore-submodules --
  14. then
  15. echo >&2 "cannot $0: your index contains uncommitted changes."
  16. git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
  17. err=1
  18. fi
  19. if [ $err = 1 ]
  20. then
  21. echo >&2 "Please commit or stash them."
  22. exit 1
  23. fi
  24. read -r line < "VERSION"
  25. echo "Creating Git tag: $line"
  26. git tag -a "$line"
  27. if ! [ $? -eq 0 ]; then
  28. exit 1
  29. fi
  30. ./compile