archive.sh 529 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Part of Zombie Navigator
  3. # Copyright © 2015 Zombie Navigator Developers
  4. dir="`dirname "$0"`"
  5. dir="`cd "$dir";pwd`"
  6. cd "$dir/src"
  7. package="`basename "$dir"`"
  8. if ! which git >/dev/null 2>&1 ; then
  9. echo "Please install git somewhere in PATH" >&2
  10. exit 1
  11. fi
  12. tree="$1"
  13. [ ! "$tree" ] && tree="master"
  14. if ! which 7z >/dev/null 2>&1 ; then
  15. git archive --prefix="$package"_"$tree"/ "$tree" | gzip -9
  16. else
  17. git archive --prefix="$package"_"$tree"/ "$tree" | 7z a dummy -tgzip -si -so -mx=9
  18. fi
  19. # vim: ts=4 noet ai