Skip to content

Commit dc5191c

Browse files
add colors & fix cache dir
make sure to create cache dir first .. & added colors for mini functions
1 parent 8bfaa6b commit dc5191c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/udroid/udroid.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ D_SCRIPTS="${TERMUX}/usr/etc/proot-distro"
55
D_INSTALLED_ROOTFS="${TERMUX}/usr/var/lib/proot-distro/installed-rootfs"
66
D_CACHCE="${HOME}/.udroid-cache-root"
77

8+
_c_magneta="\e[95m"
9+
_c_green="\e[32m"
10+
_c_red="\e[31m"
11+
_c_blue="\e[34m"
12+
813
die() { echo -e "${RED}[E] ${*}${RST}";exit 1;:;}
914
warn() { echo -e "${RED}[W] ${*}${RST}";:;}
1015
shout() { echo -e "${DS}[-] ${*}${RST}";:;}
@@ -166,7 +171,7 @@ download() {
166171
url=$1
167172
location=$2
168173
curl -L -o $location $url || {
169-
die "This action requires connection to the internet."
174+
die "Download operation failed."
170175
}
171176
}
172177

@@ -179,3 +184,8 @@ if [ $# -ge 0 ]; then
179184
*) l_login $*;;
180185
esac
181186
fi
187+
188+
# make sure to create cache dir first
189+
if [ ! -d "$D_CACHCE" ]; then
190+
mkdir -p "$D_CACHCE"
191+
fi

0 commit comments

Comments
 (0)