Skip to content

Instantly share code, notes, and snippets.

@sharafian
Created January 25, 2017 14:18
Show Gist options
  • Save sharafian/f80471a1a645c9abae98e15622b63df5 to your computer and use it in GitHub Desktop.
Save sharafian/f80471a1a645c9abae98e15622b63df5 to your computer and use it in GitHub Desktop.
Run NPM scripts without actually using NPM
#!/bin/bash
set -e
export PATH="`pwd`/node_modules/.bin/:$PATH"
CMD="`cat package.json | jq -r ".scripts.$1"`"
echo -e "Running \x1b[32m'$CMD'\x1b[39m ... "
eval "$CMD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment