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() {
|
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"
|
printf ">> Checking for valid download backend...\n"
|
||||||
whereis wget
|
whereis wget
|
||||||
whereis curl
|
whereis curl
|
||||||
@ -197,7 +197,7 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-v|--version)
|
-v|--version)
|
||||||
printf "$blue Glacier v3.1.0$reset\n"
|
printf "$blue Glacier v3.1.1$reset\n"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-f|-install)
|
-f|-install)
|
||||||
@ -205,6 +205,11 @@ case $1 in
|
|||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
printf "$blue[ i ]$reset Installing package '$2'.\n"
|
||||||
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
@ -226,6 +231,11 @@ case $1 in
|
|||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
printf "$blue[ i ]$reset Updating package '$2'.\n"
|
||||||
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
@ -248,6 +258,11 @@ case $1 in
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
printf "$blue[ i ]$reset Removing package '$2'.\n"
|
||||||
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
@ -264,6 +279,11 @@ case $1 in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-q|query)
|
-q|query)
|
||||||
|
if [ "$2" == "" ]; then
|
||||||
|
printf "$red[ $error ]$reset No package name was supplied.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
query "$@"
|
query "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@ -273,6 +293,11 @@ case $1 in
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
printf "$blue[ i ]$reset Caching package '$2'.\n"
|
||||||
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
@ -290,6 +315,11 @@ case $1 in
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
printf "$blue[ i ]$reset Installing package '$2' from cache.\n"
|
||||||
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user