Created
May 9, 2020 18:31
-
-
Save JimLynchCodes/e25c3e97088f01d9e419316d82cafe65 to your computer and use it in GitHub Desktop.
Run this bash script with arbitrary arguments, and it will call "npm start" with those arguments. If no arguments passed in it just runs "npm start".
This file contains hidden or 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 | |
npm_parameters="" | |
if [ "$#" -eq "0" ]; then | |
npm start | |
exit | |
fi | |
for i in $@ | |
do | |
npm_parameters="$npm_parameters $i" | |
done | |
eval npm start -- $npm_parameters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment