Skip to content

Commit f576dd1

Browse files
fix: add messages
1 parent c6c8706 commit f576dd1

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

udroid/src/help_udroid.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#
77

88
# help_login: show help for login
9+
# TODO: document --custom|--custom-distro|-cd
910
help_login() {
1011
echo "udroid [ login| --login ] [<options>] <suite>:<varient> <cmd>"
1112
echo "login to a suite"

udroid/src/udroid.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,23 @@ INFO() { echo -e "\e[32m${*}\e[0m";:;}
2828
TITLE() { echo -e "\e[100m${*}\e[0m";:;}
2929

3030
EDIE() {
31-
local log=$*
32-
ELOG $log
33-
DIE $log
31+
local msg=$1
32+
local hint=$2
33+
local defer_func=$3
34+
35+
ELOG $msg
36+
echo -e "\e[1m${msg}\e[0m"
37+
38+
# print hint in grey color
39+
[[ -n $hint ]] && GWARN $hint
40+
41+
# if defer_func is set, print a message and call the function
42+
if [[ -n $defer_func ]]; then
43+
LOG "Run ${defer_func} to continue"
44+
$defer_func || {
45+
echo -e "\e[1m${defer_func} failed\e[0m - ignoring"
46+
}
47+
fi
3448
}
3549

3650
# Fetch distro data from the internet and save it to RTCACHE
@@ -291,14 +305,14 @@ install_custom() {
291305
done
292306

293307
[[ -z $file ]] && {
294-
EDIE "--file not supplied"
308+
EDIE "--file not supplied" "\t requies full path of file\n\t ex: /data/data/..../ubuntu.tar.gz"
295309
}
296310
[[ -z $name ]] && {
297-
EDIE "--name not supplied"
311+
EDIE "--name not supplied" "\t requies name of filesystem\n\t ex: ubuntu"
298312
}
299313

300314
[[ ! -f $file ]] && {
301-
EDIE "file $file not found - try provide full path of file"
315+
EDIE "file $file not found" "\t try provide full path of file"
302316
}
303317

304318
[[ -d $DEFAULT_FS_INSTALL_DIR/$name ]] && {
@@ -307,11 +321,12 @@ install_custom() {
307321
exit 1
308322
}
309323

310-
TITLE "Installing $name - CUSTOM"
324+
TITLE "Installing $name - (custom)"
311325

312326
final_name="custom-$name"
313327
# Start Extracting
314328
msg_extract "$DEFAULT_FS_INSTALL_DIR/$final_name"
329+
mkdir -p $DEFAULT_FS_INSTALL_DIR/$final_name
315330
p_extract --file "$file" --path "$DEFAULT_FS_INSTALL_DIR/$final_name"
316331

317332
# apply proot-fixes

0 commit comments

Comments
 (0)