v3.1.1 - Improved error handling
This commit is contained in:
parent
d419e95f1c
commit
1c62bd5b19
34
src/glacier
34
src/glacier
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user