mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Merge pull request #1491 from pi-hole/fix/ResetInRepoDir
Change directory before trying to reset repository
This commit is contained in:
commit
98fdb95645
@ -220,6 +220,16 @@ getGitFiles() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetRepo() {
|
||||||
|
local directory="${1}"
|
||||||
|
|
||||||
|
cd "${directory}" &> /dev/null || return 1
|
||||||
|
echo -n "::: Resetting repo in ${1}..."
|
||||||
|
git reset --hard &> /dev/null || return $?
|
||||||
|
echo " done!"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
find_IPv4_information() {
|
find_IPv4_information() {
|
||||||
local route
|
local route
|
||||||
# Find IP used to route to outside world
|
# Find IP used to route to outside world
|
||||||
@ -1190,7 +1200,16 @@ update_dialogs() {
|
|||||||
clone_or_update_repos() {
|
clone_or_update_repos() {
|
||||||
if [[ "${reconfigure}" == true ]]; then
|
if [[ "${reconfigure}" == true ]]; then
|
||||||
echo "::: --reconfigure passed to install script. Resetting changes to local repos"
|
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
|
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} || \
|
||||||
|
Loading…
Reference in New Issue
Block a user