-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from jackstockley89/update
fix: addinng fix to bashrc and brew check
- Loading branch information
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
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
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
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 |