Skip to content

Commit 4126249

Browse files
added feature(changeble branch with env)
1 parent d5f265a commit 4126249

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

install.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ DC=${BLUE}
1313

1414
#GREEN_THIN="\e[32m"
1515

16+
# * Used for testing
17+
if [ -n "$HIPPO_BRANCH" ]; then
18+
BRANCH="$HIPPO_BRANCH"
19+
fi
20+
21+
1622
CACHE_ROOT="${HOME}/.uoa-cache-root"
1723
TPREFIX="/data/data/com.termux/files"
1824
#BIN_DIR="${TPREFIX}/usr/bin"
@@ -56,11 +62,16 @@ function setup_and_clone()
5662

5763
if [ -d "${CACHE_ROOT}" ]; then
5864
shout "Removing old cache......."
59-
rm -rf "${CACHE_ROOT}"
65+
rm -rf "${CACHE_ROOT:?}/"*
6066
fi
6167

62-
git clone ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
63-
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
68+
if [ -n "${BRANCH}" ]; then
69+
git clone -b "${BRANCH}" ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
70+
git clone -b "${BRANCH}" ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
71+
else
72+
git clone ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
73+
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
74+
fi
6475

6576
install
6677
}

0 commit comments

Comments
 (0)