Last active
April 15, 2020 03:37
-
-
Save hisaac/f59b19d04a1f3e4e0f2f97a9d802ed4a to your computer and use it in GitHub Desktop.
Some fish shell functions that I use
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
# A few simple fish functions I use in my config.fish file | |
function gcd -d "Switches to the develop or development branch, depending on which one is used in this repo" | |
if git show-ref --verify --quiet refs/heads/develop | |
git checkout develop | |
else | |
git checkout development | |
end | |
end | |
# The `upd` function relies on the `pip_upgrade_outdated` python library | |
# https://github.com/defjaf/pip_upgrade_outdated | |
function upd -d "Updates Global Packages" | |
# Move to the home directory | |
pushd ~/ | |
echo "πΊ Updating Homebrew" | |
brew upgrade | |
echo "π Updating RubyGems" | |
gem update --system --no-document | |
gem update --no-document | |
echo "π Updating pip" | |
pip_upgrade_outdated | |
echo "π’ Updating Casks" | |
brew cask upgrade | |
echo "π Updating Mac App Store Apps" | |
mas upgrade | |
echo "π Updating Global Node Modules" | |
npm update -g npm | |
npm update -g | |
# Move to whichever directory the script was originally run from | |
popd | |
end | |
function checkup -d "Checks Package Managers for Issues" | |
# Move to the home directory | |
pushd ~/ | |
echo "πΊ Checking Homebrew" | |
brew doctor | |
echo "π’ Checking Casks" | |
brew cask doctor | |
echo "π Checking RubyGems" | |
gem check | |
echo "π Checking pip" | |
pip check | |
echo "π Checking npm" | |
npm cache verify | |
# Move to whichever directory the script was originally run from | |
popd | |
end | |
function cleanup -d "Cleans Up Package Managers Caches" | |
# Move to the home directory | |
pushd ~/ | |
echo "πΊπ’ Cleaning Homebrew and Casks" | |
brew cleanup | |
echo "π Cleaning RubyGems" | |
gem cleanup | |
echo "π Cleaning npm" | |
npm cache clean --force | |
# Move to whichever directory the script was originally run from | |
popd | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment