Skip to content

Commit

Permalink
Merge pull request #244 from iAGorynT/iAGorynT-Code-Snippet-Changes
Browse files Browse the repository at this point in the history
Added Homebrew Autoudpate Functionality
  • Loading branch information
iAGorynT authored Dec 30, 2023
2 parents f83ea44 + 2b177da commit 447aac8
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 2 deletions.
1 change: 0 additions & 1 deletion DotFiles/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ alias brewit="Brewit.sh" # Update Homebrew
alias brewdep="clear; brew deps --formula --installed" # List Dependencies
alias brewdocm="Brewdocm.sh" # Brew Doctor
alias brewtap="clear; brew tap" # List All Taps
alias brewauh="clear; brew autoupdate --help | more" # Homebrew Autoupdate Help

# Main Menu Commands
alias mm="Mm.sh" # Main Menu - All Menus
Expand Down
86 changes: 86 additions & 0 deletions ShellScripts/Brewautom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/zsh

# Trap Ctl-C and Require a Menu Selection to Exit Script
trap 'echo -e "\nCtrl-C will not terminate $0."' INT

function autoupdatestart {
clear
echo "Starting Brew Autoupdate..."
echo
brew autoupdate start --upgrade --greedy --cleanup --enable-notification --immediate
}

function autoupdatestatus {
clear
echo "Brew Autoupdate Status..."
echo
brew autoupdate status
}

function autoupdatestop {
clear
echo "Brew Autoupdate Stop..."
echo
brew autoupdate stop
}

function autoupdatedelete {
clear
echo "Brew Autoupdate Delete..."
echo
brew autoupdate delete
}

function autoupdatehelp {
clear
echo "Brew Autoupdate Help..."
echo
brew autoupdate --help | more
}

function menu {
clear
echo
echo -e "\t\t\tBrew Autoupdate Menu\n"
echo -e "\t1. Start Autoupdate"
echo -e "\t2. Autoupdate Status"
echo -e "\t3. Stop Autoupdate"
echo -e "\t4. Delete Autoupdate"
echo -e "\t5. Autoupdate Help"
echo -e "\t0. Exit Menu\n\n"
echo -en "\t\tEnter an Option: "
read -k 1 option
}

while [ 1 ]
do
menu
case $option in
0)
break ;;
1)
autoupdatestart ;;

2)
autoupdatestatus ;;

3)
autoupdatestop ;;

4)
autoupdatedelete ;;

5)
autoupdatehelp ;;

*)
clear
echo "Sorry, wrong selection";;
esac
echo -en "\n\n\t\t\tHit any key to continue"
read -k 1 line
done
clear

# Reset Trap Ctl-C
trap INT
11 changes: 10 additions & 1 deletion ShellScripts/Brewm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ function brewdocm {
brewdocm.sh
}

function brewautom {
clear
brewautom.sh
}

function mvexplore {
clear
mvexplore.sh
Expand All @@ -75,7 +80,8 @@ function menu {
echo -e "\t5. Brew App Listing"
echo -e "\t6. Brew Taps"
echo -e "\t7. Brew Doctor"
echo -e "\t8. MacVim Explore"
echo -e "\t8. Brew Autoupdate"
echo -e "\t9. MacVim Explore"
echo -e "\t0. Exit Menu\n\n"
echo -en "\t\tEnter an Option: "
read -k 1 option
Expand Down Expand Up @@ -110,6 +116,9 @@ do
brewdocm;;

8)
brewautom;;

9)
mvexplore;;

*)
Expand Down

0 comments on commit 447aac8

Please sign in to comment.