mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Change directory before trying to reset repository. Fixes #1489
This commit is contained in:
parent
2ef87ad110
commit
74eb8c8622
1 changed files with 23 additions and 1 deletions
|
@ -220,6 +220,19 @@ getGitFiles() {
|
|||
return 0
|
||||
}
|
||||
|
||||
resetRepo() {
|
||||
local directory="${1}"
|
||||
local curdir
|
||||
|
||||
curdir="${PWD}"
|
||||
cd "${directory}" &> /dev/null || return 1
|
||||
echo -n "::: Resetting repo in ${1}..."
|
||||
git reset --hard &> /dev/null || return $?
|
||||
echo " done!"
|
||||
cd "${curdir}" &> /dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
find_IPv4_information() {
|
||||
local route
|
||||
# Find IP used to route to outside world
|
||||
|
@ -1182,7 +1195,16 @@ update_dialogs() {
|
|||
clone_or_update_repos() {
|
||||
if [[ "${reconfigure}" == true ]]; then
|
||||
echo "::: --reconfigure passed to install script. Resetting changes to local repos"
|
||||
git reset --hard
|
||||
resetRepo ${PI_HOLE_LOCAL_REPO} || \
|
||||
{ echo "!!! Unable to reset ${PI_HOLE_LOCAL_REPO}, unable to continue."; \
|
||||
exit 1; \
|
||||
}
|
||||
if [[ ${INSTALL_WEB} == true ]]; then
|
||||
resetRepo ${webInterfaceDir} || \
|
||||
{ echo "!!! Unable to reset ${webInterfaceDir}, unable to continue."; \
|
||||
exit 1; \
|
||||
}
|
||||
fi
|
||||
else
|
||||
# Get Git files for Core and Admin
|
||||
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \
|
||||
|
|
Loading…
Reference in a new issue