chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / vu / vue-language-server / update.sh
blob36321e8a306332e6cc1398a0b460944a5fe37701
1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p gnused nix nodejs prefetch-npm-deps wget
4 set -euo pipefail
5 pushd "$(dirname "${BASH_SOURCE[0]}")"
7 version=$(npm view @vue/language-server version)
8 tarball="language-server-$version.tgz"
9 url="https://registry.npmjs.org/@vue/language-server/-/$tarball"
11 if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
12 echo "Already up to date!"
13 exit 0
16 sed -i 's#version = "[^"]*"#version = "'"$version"'"#' package.nix
18 sha256=$(nix-prefetch-url "$url")
19 src_hash=$(nix-hash --to-sri --type sha256 "$sha256")
20 sed -i 's#hash = "[^"]*"#hash = "'"$src_hash"'"#' package.nix
22 rm -f package-lock.json package.json *.tgz
23 wget "$url"
24 tar xf "$tarball" --strip-components=1 package/package.json
25 npm i --package-lock-only --ignore-scripts
26 npm_hash=$(prefetch-npm-deps package-lock.json)
27 sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' package.nix
28 rm -f package.json *.tgz
30 popd