depot/third_party/nixpkgs/pkgs/servers/monitoring/karma/generate-dependencies.sh
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

30 lines
862 B
Bash
Executable file

#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix nodejs-18_x gnused wget
# Usage: ./generate-dependencies.sh <version>
# Use the same version format as in ./default.nix (without the 'v')
set -eou pipefail
version=$1
echo "Karma version: $version"
cd "$(dirname $(readlink -f $0))"
wget -O ./package-lock.json https://raw.githubusercontent.com/prymitive/karma/v$version/ui/package-lock.json
wget -O ./package.json https://raw.githubusercontent.com/prymitive/karma/v$version/ui/package.json
sed -i -e 's/"name": "ui",/"name": "karma-ui",/g' ./package.json
sed -i -e 's/"name": "ui",/"name": "karma-ui",/g' ./package-lock.json
node2nix \
--nodejs-18 \
--development \
-l ./package-lock.json \
-i ./package.json \
-o ./node-packages.nix \
-c ./node-composition.nix \
-e ./node-env.nix
rm package-lock.json