mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 22:00:17 +00:00
make_repo
more defensive.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
ffb8a74111
commit
ab9c8f4859
1 changed files with 8 additions and 8 deletions
|
@ -161,11 +161,8 @@ make_repo() {
|
||||||
if [[ -d "${directory}" ]]; then
|
if [[ -d "${directory}" ]]; then
|
||||||
rm -rf "${directory}"
|
rm -rf "${directory}"
|
||||||
fi
|
fi
|
||||||
if ! git clone -q --depth 1 "${remoteRepo}" "${directory}" &> /dev/null; then
|
git clone -q --depth 1 "${remoteRepo}" "${directory}" &> /dev/null || return $?
|
||||||
return $?
|
echo " done!"
|
||||||
else
|
|
||||||
echo " done!"
|
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +186,10 @@ getGitFiles() {
|
||||||
if is_repo "${directory}"; then
|
if is_repo "${directory}"; then
|
||||||
update_repo "${directory}"
|
update_repo "${directory}"
|
||||||
else
|
else
|
||||||
make_repo "${directory}" "${remoteRepo}" || { echo "!!! Unable to clone ${remoteRepo}"; return 1; }
|
make_repo "${directory}" "${remoteRepo}" || \
|
||||||
|
{ echo "!!! Unable to clone ${remoteRepo} into ${directory}"; \
|
||||||
|
return 1; \
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -1091,8 +1091,8 @@ main() {
|
||||||
echo "::: --reconfigure passed to install script. Not downloading/updating local repos"
|
echo "::: --reconfigure passed to install script. Not downloading/updating local repos"
|
||||||
else
|
else
|
||||||
# Get Git files for Core and Admin
|
# Get Git files for Core and Admin
|
||||||
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl}
|
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || { echo "Unable to clone ${piholeGitUrl}"; exit 1; }
|
||||||
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl}
|
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || { echo "Unable to clone ${webInterfaceGitUrl}"; exit 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${useUpdateVars} == false ]]; then
|
if [[ ${useUpdateVars} == false ]]; then
|
||||||
|
|
Loading…
Reference in a new issue