Skip to content

Commit

Permalink
Merge pull request #35 from jackstockley89/update
Browse files Browse the repository at this point in the history
fix: addinng fix to bashrc and brew check
  • Loading branch information
jackstockley89 authored Mar 18, 2022
2 parents e50ed28 + 8603e91 commit fee02a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ source <(kubectl completion bash)

## read aliases file
if [ -f ~/.bash_aliases ]; then
. ~/..bash_aliases
. ~/.bash_aliases
fi

## read function file
if [ -f ~/.bash_functions ]; then
. ~/..bash_functions
. ~/.bash_functions
fi
36 changes: 24 additions & 12 deletions brew-version-check.bash
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
#!/bin/bash
#set -x
bold="$(tput bold)"
underline="$(tput smul)"
standout="$(tput smso)"
normal="$(tput sgr0)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"

echo -e "Current Package Versions"
brew list --versions awscli git kubectl vim go tfenv aws-vault
echo -e "Would you like to continue to view outdated package versions?"
echo -e "\n${bold}${yellow}Current Package Versions${normal}"
brew list --versions awscli git kubectl vim go tfenv aws-vault cloud-platform-cli helm
echo -e "\n${yellow}Would you like to continue to view outdated package versions?${normal}"
read -p '[y/n]: ' yesnovar

if [ $yesnovar == n ]; then
exit 0
elif [ $yesnovar == y ]; then
echo -e "\nOutdated Versions"
outdated=`brew outdated`
count=${outdated} | wc -l
echo "${outdated}"
if [ ${count} > 0 ]; then
echo -e "\nWould you like to upgrade outdated packages?"
echo -e "\n${bold}${yellow}Outdated Versions${normal}"
brew outdated
outdated=`brew outdated | wc -l`
if [[ $outdated -gt 0 ]]; then
echo -e "\n${yellow}Would you like to upgrade outdated packages?${normal}"
read -p '[y/n]: ' yesnovar
if [ $yesnovar == n ]; then
exit
elif [ $yesnovar == y ]; then
brew upgrade
else
echo "Unknown Response $yesnovar"
echo -e "\n${bold}${red}Unknown Response $yesnovar${normal}"
exit 1
fi
else
echo -e "Nothing to upgrade"
echo -e "${green}Nothing to upgrade${normal}"
exit
fi
else
echo "Unknown Response $yesnovar"
echo -e "\n${bold}${red}Unknown Response $yesnovar${normal}"
exit 1
fi

0 comments on commit fee02a2

Please sign in to comment.