File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,18 @@ fn_install_file() {
320320 exit
321321}
322322
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+
323335# Prevent LinuxGSM from running as root. Except if doing a dependency install.
324336if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ]; then
325337 if [ " ${userinput} " == " install" ] || [ " ${userinput} " == " auto-install" ] || [ " ${userinput} " == " i" ] || [ " ${userinput} " == " ai" ]; then
You can’t perform that action at this time.
0 commit comments