chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ug / uglify-js / update.sh
bloba9ebcf39e93b65b524ebaf25333745bccd272eb3
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p ripgrep common-updater-scripts nodejs prefetch-npm-deps jq
4 set -xeu -o pipefail
6 PACKAGE_DIR="$(realpath "$(dirname "$0")")"
7 cd "$PACKAGE_DIR/.."
8 while ! test -f flake.nix; do cd .. ; done
9 NIXPKGS_DIR="$PWD"
11 version="$(
12 list-git-tags --url=https://github.com/mishoo/UglifyJS \
13 | rg '^v([\d.]+)$' -r '$1' \
14 | sort --version-sort \
15 | tail -n1
17 update-source-version uglify-js "$version"
19 TMPDIR="$(mktemp -d)"
20 trap "rm -rf '$TMPDIR'" EXIT
21 cd "$TMPDIR"
23 src="$(nix-build --no-link "$NIXPKGS_DIR" -A uglify-js.src)"
24 cp $src/package*.json .
26 # Maybe one day upstream may ship a package-lock.json,
27 # until then we must generate a fresh one
28 test -f package-lock.json || npm install --package-lock-only
29 cp -v package-lock.json "$PACKAGE_DIR/package-lock.json"
31 prev_npm_hash=$(
32 nix-instantiate "$NIXPKGS_DIR" \
33 --eval --json -A uglify-js.npmDepsHash \
34 | jq -r .
36 new_npm_hash=$(prefetch-npm-deps ./package-lock.json)
37 sd --fixed-strings "$prev_npm_hash" "$new_npm_hash" "$PACKAGE_DIR/package.nix"