Last active
January 24, 2022 14:59
-
-
Save ShockwaveNN/a04d3419c3956aec556f759283a1556e to your computer and use it in GitHub Desktop.
master_update
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
#!/usr/bin/env bash | |
# https://gist.github.com/ShockwaveNN/a04d3419c3956aec556f759283a1556e/edit | |
master_branch_exists=$(git ls-remote --heads origin master) | |
if [[ -z ${master_branch_exists} ]]; then | |
git checkout main | |
else | |
git checkout master | |
fi | |
git pull --prune | |
GEMFILE=Gemfile | |
GEMS=gems.rb | |
SHOULD_BUNDLE=false | |
if test -f "$GEMFILE"; then | |
SHOULD_BUNDLE=true | |
fi | |
if test -f "$GEMS"; then | |
SHOULD_BUNDLE=true | |
fi | |
if [ "$SHOULD_BUNDLE" = true ] ; then | |
echo 'Seems this is ruby project. Check gems for update' | |
bundle install | |
bundle outdated | |
fi | |
git branch -av | |
git stash list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment