v3.1.1 - Improved error handling

This commit is contained in:
lw-everestlinux 2022-11-03 12:29:31 -04:00
parent d419e95f1c
commit 1c62bd5b19

View File

@ -109,7 +109,7 @@ clear_cache() {
}
debug_info() {
printf "$blue>> Glacier v3.1.0$reset\n"
printf "$blue>> Glacier v3.1.1$reset\n"
printf ">> Checking for valid download backend...\n"
whereis wget
whereis curl
@ -197,7 +197,7 @@ case $1 in
exit 0
;;
-v|--version)
printf "$blue Glacier v3.1.0$reset\n"
printf "$blue Glacier v3.1.1$reset\n"
exit 0
;;
-f|-install)
@ -206,6 +206,11 @@ case $1 in
exit 1
fi
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
printf "$blue[ i ]$reset Installing package '$2'.\n"
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
@ -227,6 +232,11 @@ case $1 in
exit 1
fi
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
printf "$blue[ i ]$reset Updating package '$2'.\n"
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
@ -248,6 +258,11 @@ case $1 in
exit 1
fi
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
printf "$blue[ i ]$reset Removing package '$2'.\n"
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
@ -264,6 +279,11 @@ case $1 in
fi
;;
-q|query)
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
query "$@"
exit 0
;;
@ -273,6 +293,11 @@ case $1 in
exit 1
fi
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
printf "$blue[ i ]$reset Caching package '$2'.\n"
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
@ -290,6 +315,11 @@ case $1 in
exit 1
fi
if [ "$2" == "" ]; then
printf "$red[ $error ]$reset No package name was supplied.\n"
exit 1
fi
printf "$blue[ i ]$reset Installing package '$2' from cache.\n"
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then