File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ ask.case(){
27
27
read -p " ? [Y/n] " ARGS;
28
28
echo ;
29
29
case " ${ARGS} " in
30
- y|Y) return 0;;
30
+ y|Y| ' ' ) return 0;;
31
31
n|N) { say.error " Process Aborted.\n" && exit 1; };;
32
- * ) { say.error " You have to enter only\n\t\t'Y' for Yes &\n\t\t'n' for No.\n" && exit 1; };;
32
+ * ) { say.error " You have to enter only \n\t\t'Y' for Yes & \n\t\t'n' for No.\n" && exit 1; };;
33
33
esac
34
34
}
35
35
@@ -43,16 +43,15 @@ ask.case(){
43
43
ask.choice (){
44
44
PS3="
45
45
${1} > " ;
46
+ shift ;
46
47
local ARGs=(" ${@ } " );
47
- # leave first variable of array for title.
48
- local ARGs2=(" ${ARGs[@]: 1} " );
49
48
echo ;
50
- select ARG in " ${ARGs2 [@]} "
49
+ select ARG in " ${ARGs [@]} "
51
50
do
52
51
text.isdigit " ${REPLY} " || {
53
52
say.error " You can only input 'digits'.\n" && exit 1;
54
53
};
55
- [[ " ${REPLY} " -gt " ${# ARGs2 [@]} " ]] &&
54
+ [[ " ${REPLY} " -gt " ${# ARGs [@]} " ]] &&
56
55
say.error " You should input correct digits.\n" && exit 1;
57
56
askChoice=" ${ARG} " ;
58
57
askReply=" ${REPLY} " ;
Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ pkg.size(){
45
45
' MB' ) echo " ${Size} " ;;
46
46
' kB' ) echo " $(( Size/ 1024 )) " ;;
47
47
' B' ) echo " $(( Size/ 1048576 )) " ;;
48
- esac
49
- # return function.
50
- return ;
48
+ esac
51
49
}
52
50
53
51
# pkg.chart(pkgs)
@@ -114,9 +112,7 @@ pkg.install(){
114
112
do
115
113
spinner.start ' Installing' " ${ARG} " ;
116
114
# started installation.
117
- if os.is_termux; then
118
- apt-get install -qq " ${ARG} " > /dev/null;
119
- elif os.is_shell.zsh; then
115
+ if os.is_termux || os.is_shell.zsh; then
120
116
apt-get install -qq " ${ARG} " > /dev/null;
121
117
else
122
118
sudo apt-get install -qq " ${ARG} " > /dev/null;
You can’t perform that action at this time.
0 commit comments