nixpkgs/pkgs/by-name/gl/glamoroustoolkit/GlamorousToolkit-GetImage
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

26 lines
780 B
Plaintext
Executable File

#! /usr/bin/env nix-shell
#! nix-shell -i bash --packages curl
#
# Download the latest GlamorousToolkit image to the current directory, which must be empty
#
set -e
if [ ! -z "$(ls)" ]
then
echo "Warning: the directory is not empty, continuing may overwrite some files"
read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
fi
GTVERSION=$(curl -s https://api.github.com/repos/feenkcom/gtoolkit/releases/latest 2>/dev/null | grep tag_name | cut -d '"' -f 4)
if [ -z "$GTVERSION" ]
then
echo "Failed to get Gt Version string, exiting..."
exit 1
fi
curl -L \
-o gt-image.zip \
https://github.com/feenkcom/gtoolkit/releases/download/${GTVERSION}/GlamorousToolkit-Linux-x86_64-${GTVERSION}.zip
unzip gt-image.zip
rm -rf bin lib