-
-
Save lebbe/b6e2558266707346214226c1eba8d8df to your computer and use it in GitHub Desktop.
Automatically perform npm updates and make it a pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update all minor and patch versions of your own dependencies, and thereafter | |
# update all transitive dependencies. Use the JIRA-number as first and only argument. | |
# Put this, for instance, in /usr/bin and make it executable: | |
# | |
# sudo mv npmu /usr/bin/npmu | |
# sudo chmod 744 /usr/bin/npmu | |
if [ $# -lt 1 ]; then | |
echo "$0: not enough arguments, try:" | |
echo "$0 [JIRA-#]" | |
exit 2 | |
elif [ $# -gt 1 ]; then | |
echo "$0: too many arguments, try:" | |
echo "$0 [JIRA-#]" | |
exit 2 | |
fi | |
git checkout master | |
git pull | |
git checkout -b "feature/$1-update-deps" | |
npm i -g npm-check-updates | |
ncu -t minor -u | |
rm package-lock.json | |
rm -rf node_modules | |
npm cache clear --force | |
npm install | |
git add . | |
git commit -m"$1 Update minor and patch version of all deps, and update all transitive deps." | |
git push --set-upstream origin "feature/$1-update-deps" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment