This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/scripts/update-yarn.sh

22 lines
460 B
Bash
Raw Permalink Normal View History

2022-09-25 13:06:44 +00:00
#!/usr/bin/env nix-shell
2023-03-03 14:45:33 +00:00
#!nix-shell -i bash -p yarn2nix nodejs yarn
2022-09-25 13:06:44 +00:00
SOURCE=$1
2023-03-03 14:45:33 +00:00
WRITE_PATH=$(realpath $2)
SOURCE_EXTRACTED=$(mktemp -du)
cp -r $SOURCE $SOURCE_EXTRACTED
chmod -R +w $SOURCE_EXTRACTED
cd $SOURCE_EXTRACTED
yarn install
yarn upgrade
yarn2nix --lockfile $SOURCE_EXTRACTED/yarn.lock > $WRITE_PATH/yarn.nix
cp $SOURCE_EXTRACTED/package.json $WRITE_PATH/package.json
cp $SOURCE_EXTRACTED/yarn.lock $WRITE_PATH/yarn.lock
2022-09-25 13:06:44 +00:00
2023-03-03 14:45:33 +00:00
rm -rf $SOURCE_EXTRACTED