makerelease.sh 765 B

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