Bashisms
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
e647efd471
commit
68c17b26dc
|
@ -22,13 +22,15 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
||||||
is_repo() {
|
is_repo() {
|
||||||
# Use git to check if directory is currently under VCS, return the value
|
# Use git to check if directory is currently under VCS, return the value
|
||||||
local directory="${1}"
|
local directory="${1}"
|
||||||
|
local curdir
|
||||||
|
local rc
|
||||||
|
|
||||||
curdir=$PWD
|
curdir="${PWD}"
|
||||||
cd $directory
|
cd "${directory}" || { echo "Unable to change to ${directory}, exiting."; exit 1; }
|
||||||
git status --short &> /dev/null
|
git status --short &> /dev/null
|
||||||
rc=$?
|
rc=$?
|
||||||
cd $curdir
|
cd "${curdir}" || { echo "Unable to change to ${curdir}, exiting."; exit 1; }
|
||||||
return $rc
|
return "${rc}"
|
||||||
}
|
}
|
||||||
|
|
||||||
prep_repo() {
|
prep_repo() {
|
||||||
|
|
Loading…
Reference in New Issue