Skip to content

Commit 03cb327

Browse files
Merge pull request #3 from RandomCoderOrg/fix1-patch
changeable branch with env variables
2 parents a2da91e + d8fd96e commit 03cb327

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

etc/scripts/hippo/hippo.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
version=1
44

5+
if [ -n "$HIPPO_BRANCH" ]; then
6+
BRANCH="$HIPPO_BRANCH"
7+
fi
58

69
CACHE_ROOT="${HOME}/.uoa-cache-root"
710
TPREFIX="/data/data/com.termux/files"
@@ -17,6 +20,11 @@ SOCIAL_PLATFORM="\e[1;34mhttps://discord.gg/TAqaG5sEfW\e[0m"
1720
# HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}"
1821
# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh"
1922

23+
24+
die () { echo -e "${RED}Error ${*}${RST}";exit 1 ;:;}
25+
warn () { echo -e "${RED}Error ${*}${RST}";:;}
26+
shout () { echo -e "${DS}////////";echo -e "${*}";echo -e "////////${RST}";:; }
27+
2028
function __check_for_hippo() {
2129
if [ -d ${HIPPO_DIR} ] && [ -f ${HIPPO_SCRIPT_FILE} ]; then
2230
return 0;
@@ -101,7 +109,12 @@ function __force_uprade_hippo()
101109
fi
102110

103111
FSM_URL="https://github.com/RandomCoderOrg/fs-manager-hippo"
104-
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
112+
113+
if [ -z "${BRANCH}" ]; then
114+
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
115+
else
116+
git clone -b "${BRANCH}" "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
117+
fi
105118

106119
if [ -f "${CACHE_ROOT}"/fs-manager-hippo/install.sh ]; then
107120
cd "${CACHE_ROOT}"/fs-manager-hippo || die "failed to cd ..."
@@ -164,8 +177,7 @@ function _lauch_or_install()
164177
cp "${DIR}" ${HIPPO_DIR}/bin/stopvnc
165178
proot-distro login hippo -- chmod 775 /bin/stopvnc
166179
fi
167-
168-
proot-distro login hippo "$@"
180+
proot-distro login hippo "$@" || warn "program exited unexpectedly..."
169181
fi
170182
}
171183

0 commit comments

Comments
 (0)