Skip to content

Instantly share code, notes, and snippets.

@ProGM
Created December 4, 2015 16:01
Show Gist options
  • Select an option

  • Save ProGM/f1773b65cf4f531830cd to your computer and use it in GitHub Desktop.

Select an option

Save ProGM/f1773b65cf4f531830cd to your computer and use it in GitHub Desktop.
# Given an existing gulpfile.js without a package.json, runs `npm install`
# many times until all package required get installed
package_name=gulp
while [[ $package_name ]]; do
npm install $package_name
package_name=`gulp 2>&1 | grep "find module" | xargs | awk '{print $NF}'`
echo "Install $package_name"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment