Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

38 lines
960 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl nix-update prefetch-npm-deps nodejs jq gnused ruby bundix
set -eu -o pipefail
# Make a temporary directory and make sure it's removed when the script exits
tmp=$(mktemp -d)
trap "rm -rf $tmp" EXIT
package_dir="$(dirname "${BASH_SOURCE[0]}")"
pushd "$package_dir"
curl -sfL ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} https://api.github.com/repos/Shopify/cli/releases/latest > $tmp/latest.json
version=$(cat $tmp/latest.json | jq -r '.tag_name')
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
echo "Already up to date!"
exit 0
fi
pushd manifests
# Update the package.json
sed -i "s|$UPDATE_NIX_OLD_VERSION|$version|g" package.json
# Update the package-lock.json
rm -f package-lock.json
npm i --package-lock-only
npm_hash=$(prefetch-npm-deps package-lock.json)
popd
sed -i "s|npmDepsHash = \".*\";|npmDepsHash = \"$npm_hash\";|" package.nix
popd
nix-update shopify-cli --version $version