Skip to content

Commit 424d7ef

Browse files
committed
move
1 parent 9ebac97 commit 424d7ef

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

linuxgsm.sh

+13-12
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ fi
5959

6060
# Core module that is required first.
6161
core_modules.sh() {
62+
# Check that git branch exists.
63+
if [ "${remotereponame}" == "GitHub" ]; then
64+
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null)
65+
else
66+
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null)
67+
fi
68+
69+
if [ "${branchexistscheck}" != "200" ]; then
70+
echo -e "${githubbranch} branch does not exist. Defaulting to master branch."
71+
githubbranch="master"
72+
fi
73+
74+
# Fetches the core modules required before passed off to core_dl.sh.
6275
modulefile="${FUNCNAME[0]}"
6376
fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5"
6477
}
@@ -320,18 +333,6 @@ fn_install_file() {
320333
exit
321334
}
322335

323-
# Check that git branch exists.
324-
if [ "${remotereponame}" == "GitHub" ]; then
325-
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null)
326-
else
327-
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null)
328-
fi
329-
330-
if [ "${branchexistscheck}" != "200" ]; then
331-
echo -e "${githubbranch} branch does not exist. Defaulting to master branch."
332-
githubbranch="master"
333-
fi
334-
335336
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
336337
if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then
337338
if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then

0 commit comments

Comments
 (0)