Skip to content

Commit c6b3c16

Browse files
feat: support old --install for best one
1 parent 5149f53 commit c6b3c16

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

udroid/src/udroid.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ install() {
127127
# local arg=$1
128128
TITLE "> INSTALL $arg"
129129
local no_check_integrity=false
130+
BEST_CURRENT_DISTRO="jammy:xfce4"
131+
INSTALL_BEST=false
130132

131133
while [[ $# -gt 0 ]]; do
132134
case $1 in
@@ -138,6 +140,10 @@ install() {
138140
help_install
139141
exit 0
140142
;;
143+
--set-best-to-install)
144+
INSTALL_BEST=true
145+
break
146+
;;
141147
*)
142148
# [[ -n $_name ]] && {
143149
# ELOG "login() error: name already set to $_name"
@@ -156,7 +162,12 @@ install() {
156162
done
157163

158164
[[ -z $arg ]] && {
159-
ELOG "\$arg not supplied"
165+
LOG "\$arg not supplied"
166+
if $INSTALL_BEST; then
167+
INFO "--install is deprecated, use distro arg <suite>:<varient> instead"
168+
INFO "user ${0} --list to see available distros"
169+
arg=$BEST_CURRENT_DISTRO
170+
fi
160171
}
161172
# parse the arg for suite and varient and get name,link
162173
parser $arg "online"
@@ -1060,7 +1071,8 @@ fi
10601071
while [ $# -gt 0 ]; do
10611072
case $1 in
10621073
help | --help|-h) shift 1; help_root; break ;;
1063-
install | --install|-i) shift 1; install $@ ; break ;;
1074+
install |-i) shift 1; install $@ ; break ;;
1075+
--install) shift 1; install --set-best-to-install ; break ;;
10641076
upgrade | --upgrade|-u) shift 1; _upgrade $@ ; break ;;
10651077
--update-cache) shift 1; update_cache $@ ; break ;;
10661078
--clear-cache) shift 1; clear_cache $@ ; break ;;

0 commit comments

Comments
 (0)