biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / glamoroustoolkit / GlamorousToolkit-GetImage
blob20c2c315a350ebe3f85fdc82a1a3c6505ee1c331
1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash --packages curl
4 # Download the latest GlamorousToolkit image to the current directory, which must be empty
6 set -e
8 if [ ! -z "$(ls)" ]
9 then
10         echo "Warning: the directory is not empty, continuing may overwrite some files"
11         read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
14 GTVERSION=$(curl -s https://api.github.com/repos/feenkcom/gtoolkit/releases/latest 2>/dev/null | grep tag_name | cut -d '"' -f 4)
15 if [ -z "$GTVERSION" ]
16 then
17         echo "Failed to get Gt Version string, exiting..."
18         exit 1
21 curl -L \
22   -o gt-image.zip \
23   https://github.com/feenkcom/gtoolkit/releases/download/${GTVERSION}/GlamorousToolkit-Linux-x86_64-${GTVERSION}.zip
24 unzip gt-image.zip
25 rm -rf bin lib