Created
November 1, 2018 10:21
-
-
Save fgaz/5fa356e61aabbf6cafe5aecfefce34f7 to your computer and use it in GitHub Desktop.
Enter a nix-shell for developing node packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
if [ -e ./node_modules ]; then | |
echo "please delete node_modules to use this script" | |
exit 1 | |
fi | |
function cleanup { | |
rm -f node_modules | |
} | |
trap cleanup EXIT | |
trap cleanup SIGTERM | |
nix-shell -p nodePackages.node2nix --run "node2nix -d -8 -l package-lock.json" | |
nix-shell -A shell --run 'ln -s "${NODE_PATH}" node_modules' | |
nix-shell -A shell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment