nixpkgs/pkgs/servers/monitoring/karma/generate-dependencies.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
862 B
Bash
Raw Normal View History

2022-10-06 09:53:42 +00:00
#! /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