Skip to content

Instantly share code, notes, and snippets.

@JimLynchCodes
Created May 9, 2020 18:31
Show Gist options
  • Save JimLynchCodes/e25c3e97088f01d9e419316d82cafe65 to your computer and use it in GitHub Desktop.
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".
#!/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