Created
September 7, 2017 21:17
-
-
Save steveh/d202598d6a36113321106fe5b70db177 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Installation: save to /usr/local/bin/update | |
# and chmod +x /usr/local/bin/update | |
# Usage: update | |
set -euo pipefail | |
if [ -d ".git" ]; then | |
dirty=$(git status --porcelain) | |
if [ -n "$dirty" ]; then | |
git add . | |
git stash | |
fi | |
git pull --rebase || true | |
if [ -n "$dirty" ]; then | |
git stash pop | |
fi | |
fi | |
if [ -f "Gemfile.lock" ]; then | |
bundle update | |
fi | |
if [ -f "yarn.lock" ]; then | |
yarn upgrade | |
elif [ -f "package.json" ]; then | |
npm update | |
fi | |
if [ -f "bower.json" ]; then | |
bower update | |
fi | |
if [ -f "composer.lock" ]; then | |
composer update | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment