mirror of
https://github.com/Le0xFF/VoidLinuxInstaller.git
synced 2024-11-22 02:46:31 +03:00
Try another way to check if custom void-packages git repo exists or not
This should also fix issue #4
This commit is contained in:
parent
1e9b3577e8
commit
fe826aa85c
27
vli.sh
27
vli.sh
@ -861,24 +861,23 @@ function void_packages {
|
||||
read -r void_packages_custom_repo void_packages_custom_branch
|
||||
|
||||
if [[ -z "$void_packages_custom_branch" ]] ; then
|
||||
repo_check=$(GIT_TERMINAL_PROMPT=0 git ls-remote "$void_packages_custom_repo" | wc -l)
|
||||
else
|
||||
repo_check=$(GIT_TERMINAL_PROMPT=0 git ls-remote "$void_packages_custom_repo" "$void_packages_custom_branch" | wc -l)
|
||||
fi
|
||||
|
||||
if [[ "$repo_check" == "1" ]] ; then
|
||||
echo -e -n "\nCustom repository ${BLUE_LIGHT}$void_packages_custom_repo${NORMAL} will be used.\n"
|
||||
|
||||
if [[ -z "$void_packages_custom_branch" ]] ; then
|
||||
if [[ "$(GIT_TERMINAL_PROMPT=0 git ls-remote --exit-code --heads "$void_packages_custom_repo" &> /dev/null ; echo "$?")" == "0" ]] ; then
|
||||
echo -e -n "\nCustom repository ${BLUE_LIGHT}$void_packages_custom_repo${NORMAL} will be used.\n"
|
||||
git_cmd="git clone $void_packages_custom_repo"
|
||||
break 2
|
||||
else
|
||||
git_cmd="git clone $void_packages_custom_repo -b $void_packages_custom_branch"
|
||||
echo -e -n "\n\nPlease enter a valid public repository url.\n\n"
|
||||
read -n 1 -r -p "[Press any key to continue...]" key
|
||||
fi
|
||||
break 2
|
||||
|
||||
else
|
||||
echo -e -n "\n\nPlease enter a valid public repository url.\n\n"
|
||||
read -n 1 -r -p "[Press any key to continue...]" key
|
||||
if [[ "$(GIT_TERMINAL_PROMPT=0 git ls-remote --exit-code --heads "$void_packages_custom_repo" "$void_packages_custom_branch" &> /dev/null ; echo "$?")" == "0" ]] ; then
|
||||
echo -e -n "\nCustom repository ${BLUE_LIGHT}$void_packages_custom_repo${NORMAL} will be used.\n"
|
||||
git_cmd="git clone $void_packages_custom_repo -b $void_packages_custom_branch"
|
||||
break 2
|
||||
else
|
||||
echo -e -n "\nPlease enter a valid public repository url.\n\n"
|
||||
read -n 1 -r -p "[Press any key to continue...]" key
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user