2022-01-13 20:06:32 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2023-01-11 07:51:40 +00:00
|
|
|
#! nix-shell -I nixpkgs=../../../.. -i bash -p nodePackages.node2nix gnused jq curl
|
|
|
|
set -eou pipefail
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
cd "$(dirname "$0")"
|
2022-08-12 12:06:08 +00:00
|
|
|
pushd ../../../../..
|
2022-01-13 20:06:32 +00:00
|
|
|
version=$(nix-instantiate --strict --eval -A ArchiSteamFarm.version | jq -r)
|
2022-06-16 17:23:12 +00:00
|
|
|
popd
|
|
|
|
pushd "$(dirname "$0")"
|
|
|
|
ui=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/contents/ASF-ui?ref=$version" | jq -r .sha)
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
curl "https://raw.githubusercontent.com/JustArchiNET/ASF-ui/$ui/package-lock.json" -o package-lock.json
|
|
|
|
curl "https://raw.githubusercontent.com/JustArchiNET/ASF-ui/$ui/package.json" -o package.json
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
# update-source-version doesn't work for some reason
|
|
|
|
sed -i "s/rev\\s*=\\s*.*/rev = \"$ui\";/" default.nix
|
2022-06-16 17:23:12 +00:00
|
|
|
sed -i "s/sha256\\s*=\\s*.*/sha256 = \"$(nix-prefetch-url --unpack "https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz")\";/" default.nix
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
node2nix \
|
|
|
|
--nodejs-14 \
|
|
|
|
--development \
|
|
|
|
--lock package-lock.json \
|
|
|
|
--node-env ../../../../development/node-packages/node-env.nix \
|
|
|
|
--output node-packages.nix \
|
|
|
|
--composition node-composition.nix \
|
|
|
|
|
|
|
|
rm package.json package-lock.json
|
|
|
|
|
|
|
|
popd
|