Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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".
#!/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
You can’t perform that action at this time.