makerelease.sh 694 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. srcdir="$(realpath "$0" | xargs dirname)"
  3. srcdir="$srcdir/.."
  4. # Import the makerelease.lib
  5. # https://bues.ch/cgit/misc.git/tree/makerelease.lib
  6. die() { echo "$*"; exit 1; }
  7. for path in $(echo "$PATH" | tr ':' ' '); do
  8. [ -f "$MAKERELEASE_LIB" ] && break
  9. MAKERELEASE_LIB="$path/makerelease.lib"
  10. done
  11. [ -f "$MAKERELEASE_LIB" ] && . "$MAKERELEASE_LIB" || die "makerelease.lib not found."
  12. hook_get_version()
  13. {
  14. local file="$1/ui/pyrazer/main.py"
  15. version="$(cat "$file" | grep -e RAZER_VERSION | head -n1 | cut -d'"' -f2)"
  16. }
  17. hook_post_checkout()
  18. {
  19. default_hook_post_checkout "$@"
  20. # Remove firmware directory from release.
  21. rm -r "$1/firmware"
  22. }
  23. project=razercfg
  24. makerelease "$@"