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(){
2727 read -p " ? [Y/n] " ARGS;
2828 echo ;
2929 case " ${ARGS} " in
30- y|Y) return 0;;
30+ y|Y| ' ' ) return 0;;
3131 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; };;
3333 esac
3434}
3535
@@ -43,16 +43,15 @@ ask.case(){
4343ask.choice (){
4444 PS3="
4545 ${1} > " ;
46+ shift ;
4647 local ARGs=(" ${@ } " );
47- # leave first variable of array for title.
48- local ARGs2=(" ${ARGs[@]: 1} " );
4948 echo ;
50- select ARG in " ${ARGs2 [@]} "
49+ select ARG in " ${ARGs [@]} "
5150 do
5251 text.isdigit " ${REPLY} " || {
5352 say.error " You can only input 'digits'.\n" && exit 1;
5453 };
55- [[ " ${REPLY} " -gt " ${# ARGs2 [@]} " ]] &&
54+ [[ " ${REPLY} " -gt " ${# ARGs [@]} " ]] &&
5655 say.error " You should input correct digits.\n" && exit 1;
5756 askChoice=" ${ARG} " ;
5857 askReply=" ${REPLY} " ;
Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ pkg.size(){
4545 ' MB' ) echo " ${Size} " ;;
4646 ' kB' ) echo " $(( Size/ 1024 )) " ;;
4747 ' B' ) echo " $(( Size/ 1048576 )) " ;;
48- esac
49- # return function.
50- return ;
48+ esac
5149}
5250
5351# pkg.chart(pkgs)
@@ -114,9 +112,7 @@ pkg.install(){
114112 do
115113 spinner.start ' Installing' " ${ARG} " ;
116114 # 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
120116 apt-get install -qq " ${ARG} " > /dev/null;
121117 else
122118 sudo apt-get install -qq " ${ARG} " > /dev/null;
You can’t perform that action at this time.
0 commit comments