Skip to content

Instantly share code, notes, and snippets.

@nothingrealhappen
Created February 20, 2017 06:21
Show Gist options
  • Save nothingrealhappen/f2ea9760ed4459edfc18ec9bbb3ab976 to your computer and use it in GitHub Desktop.
Save nothingrealhappen/f2ea9760ed4459edfc18ec9bbb3ab976 to your computer and use it in GitHub Desktop.
auto update npm package when git submodule update
#!/bin/sh
# exit when checkout a file
[ "$3" == "0" ] && exit
cd gulp
echo "Checking npm modules"
npm ls > /dev/null && {
echo "All package was fresh"
} || {
echo "Running 'npm install' to install missed package" >&2
npm install --loglevel error && npm prune
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment