codesnap: init at 0.8.2 (#364266)
[NixPkgs.git] / pkgs / by-name / av / avalonia / update.bash
blobb0ceaaa03eec945eee3dc8a4429bca7d28a9ee7f
1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p nix-update -p prefetch-npm-deps
3 #shellcheck shell=bash
5 set -euo pipefail
7 package="$UPDATE_NIX_ATTR_PATH"
8 nix-update "$package"
9 src=$(nix-build -A "$package".src --no-out-link)
10 npmDepsFile=$(nix-instantiate --eval -A "$package".npmDepsFile)
12 echo '['
13 for path in \
14 src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp \
15 tests/Avalonia.DesignerSupport.Tests/Remote/HtmlTransport/webapp \
16 src/Browser/Avalonia.Browser/webapp
18 echo ' {'
19 echo " path = \"$path\";"
20 echo prefetch-npm-deps "$src/$path/package-lock.json" >&2
21 hash=$(prefetch-npm-deps "$src/$path/package-lock.json")
22 echo " hash = \"$hash\";"
23 echo ' }'
24 done
25 echo ']'
26 ) > "$npmDepsFile"
27 "$(nix-build -A "$package".fetch-deps --no-out-link)"