Skip to content

Commit f52612f

Browse files
More addtitions
- messgaes to show progress - apply fixes after extraction (exec: proot-fixes.sh) - installation conformation message
1 parent 645a063 commit f52612f

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

udroid/src/udroid.sh

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ install() {
162162
# cause it make better use of path
163163
if [[ -z $path ]]; then
164164
# echo "$link + $name"
165+
msg_download $name $link "$DEFAULT_FS_INSTALL_DIR/$name"
165166
download "$name.tar.$ext" "$link"
166167

167168
# Start Extracting
@@ -171,8 +172,12 @@ install() {
171172
mkdir -p $name
172173

173174
# call proot extract
175+
msg_extract "$DEFAULT_FS_INSTALL_DIR/$name"
174176
p_extract --file "$DLCACHE/$name.tar.$ext" --path "$DEFAULT_FS_INSTALL_DIR/$name"
177+
178+
gum_spin minidot "Applying proot fixes" bash proot-utils/proot-fixes.sh "$DEFAULT_FS_INSTALL_DIR/$name"
175179
else
180+
msg_download $name $link "$path/$name"
176181
download "$name.tar.$ext" "$link" "$path"
177182

178183
[[ -d $path ]] && {
@@ -182,15 +187,25 @@ install() {
182187
ELOG "ERROR: path $path not found"
183188
echo "ERROR: path $path not found"
184189
}
190+
191+
msg_extract "$path/$name"
185192
p_extract --file "$path/$name.tar.$ext" --path "$path/$name"
193+
194+
gum_spin minidot "Applying proot fixes" bash proot-utils/proot-fixes.sh "$path/$name"
186195
fi
187196

197+
echo -e "[\xE2\x9C\x94] $name installed."
198+
188199
}
189200

190201
login() {
191202
:
192203
}
193204

205+
list() {
206+
:
207+
}
208+
194209
remove() {
195210
:
196211
}
@@ -211,6 +226,27 @@ download() {
211226
exit 1
212227
}
213228
}
229+
230+
msg_download() {
231+
local name=$1
232+
local path=$2
233+
local link=$3
234+
235+
grey_color="\e[90m"
236+
reset_color="\e[0m"
237+
238+
echo -e "Downloading $name filesystem ${grey_color}($link)${reset_color}"
239+
echo -e ":[PATH]= ${grey_color}${path}${reset_color}"
240+
}
241+
242+
msg_extract() {
243+
local path=$1
244+
245+
echo
246+
echo -e "Extracting filesystem to ${grey_color}${path}${reset_color}"
247+
echo -e "This may take a while..."
248+
echo
249+
}
214250
####################
215251

216252
if [ $# -eq 0 ]; then
@@ -220,8 +256,8 @@ fi
220256

221257
while [ $# -gt 0 ]; do
222258
case $1 in
223-
--install|-i) shift 1; install $1; break ;;
224-
--login|-l) ;;
259+
--install|-i) shift 1; install "$*" ; break ;;
260+
--login|-l) shift 1; login "$*"; break ;;
225261
--remove | --uninstall ) ;;
226262
*) echo "unkown option [$1]"; break ;;
227263
esac

0 commit comments

Comments
 (0)