mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-18 06:08:21 +00:00
Utility functions fully quiet now. Calling functions have the echos.
This commit is contained in:
parent
bd68db51e0
commit
3f61aea7fc
@ -45,17 +45,17 @@ make_repo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_repo() {
|
update_repo() {
|
||||||
local dest_dir="${1}"
|
local directory="${1}"
|
||||||
|
local retVal=0
|
||||||
# Pull the latest commits
|
# Pull the latest commits
|
||||||
echo -n "::: Updating repository in ${dest_dir}..."
|
|
||||||
|
|
||||||
# Stash all files not tracked for later retrieval
|
# Stash all files not tracked for later retrieval
|
||||||
git -C "${dest_dir}" stash --all --quiet &> /dev/null || false
|
git -C "${directory}" stash --all --quiet &> /dev/null || ${retVal}=1
|
||||||
# Force a clean working directory for cloning
|
# Force a clean working directory for cloning
|
||||||
git -C "${dest_dir}" clean --force -d &> /dev/null || false
|
git -C "${directory}" clean --force -d &> /dev/null || ${retVal}=1
|
||||||
# Fetch latest changes and apply
|
# Fetch latest changes and apply
|
||||||
git -C "${dest_dir}" pull --quiet &> /dev/null || false
|
git -C "${directory}" pull --quiet &> /dev/null || ${retVal}=1
|
||||||
echo " done!"
|
return ${retVal}
|
||||||
}
|
}
|
||||||
|
|
||||||
getGitFiles() {
|
getGitFiles() {
|
||||||
@ -66,7 +66,9 @@ getGitFiles() {
|
|||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Checking for existing repository..."
|
echo "::: Checking for existing repository..."
|
||||||
if is_repo "${directory}"; then
|
if is_repo "${directory}"; then
|
||||||
|
echo -n "::: Updating repository in ${directory}..."
|
||||||
update_repo "${directory}" || (echo "*** Error: Could not update local repository. Contact support."; exit 1)
|
update_repo "${directory}" || (echo "*** Error: Could not update local repository. Contact support."; exit 1)
|
||||||
|
echo " done!"
|
||||||
else
|
else
|
||||||
echo -n "::: Cloning ${remoteRepo} into ${directory}..."
|
echo -n "::: Cloning ${remoteRepo} into ${directory}..."
|
||||||
make_repo "${directory}" "${remoteRepo}" || (echo "Unable to clone repository, please contact support"; exit 1)
|
make_repo "${directory}" "${remoteRepo}" || (echo "Unable to clone repository, please contact support"; exit 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user