diff --git a/pkgs/servers/web-apps/snipe-it/update.sh b/pkgs/servers/web-apps/snipe-it/update.sh index 3e5f70f1a587..226c71af3e34 100755 --- a/pkgs/servers/web-apps/snipe-it/update.sh +++ b/pkgs/servers/web-apps/snipe-it/update.sh @@ -1,5 +1,43 @@ #!/usr/bin/env nix-shell #! nix-shell -I nixpkgs=../../../.. -i bash -p nix curl jq nix-update +# shellcheck shell=bash +cd "$(dirname "$0")" + +usage () { + cat < /dev/null; then @@ -44,7 +82,18 @@ sed -e '7s/stdenv writeTextFile/stdenv lib writeTextFile/' \ echo "" >> composition.nix echo "" >> php-packages.nix -cd ../../../.. -nix-build -A snipe-it +if [ -z ${DONT_BUILD+x} ]; then + ( + cd ../../../.. + nix-build -A snipe-it + ) +fi + +if [ -n "$COMMIT_CHANGES" ]; then + git add . + git commit -m "snipe-it: $CURRENT_VERSION -> $TARGET_VERSION + +https://github.com/snipe/snipe-it/releases/tag/v$TARGET_VERSION" +fi exit $?