stdenv: fix documentation for stripAllFlags and stripDebugFlags (#352127)
[NixPkgs.git] / pkgs / tools / package-management / yarn-lock-converter / update.sh
blob72d46b470f287c118d78e616cc02d4c92e2f010e
1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p nodejs libarchive prefetch-npm-deps moreutils
3 # shellcheck shell=bash
5 set -exuo pipefail
7 cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
9 TMPDIR="$(mktemp -d)"
10 trap 'rm -r -- "$TMPDIR"' EXIT
12 pushd -- "$TMPDIR"
13 npm pack "@vht/yarn-lock-converter" --json | jq '.[0] | { version, integrity, filename }' > source.json
14 bsdtar -x -f "$(jq -r .filename source.json)"
16 pushd package
17 npm install --package-lock-only
18 popd
20 DEPS="$(prefetch-npm-deps package/package-lock.json)"
21 jq ".deps = \"$DEPS\"" source.json | sponge source.json
23 popd
25 cp -t . -- "$TMPDIR/source.json" "$TMPDIR/package/package-lock.json"