mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Bashisms
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
e647efd471
commit
68c17b26dc
1 changed files with 6 additions and 4 deletions
|
@ -22,13 +22,15 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
|||
is_repo() {
|
||||
# Use git to check if directory is currently under VCS, return the value
|
||||
local directory="${1}"
|
||||
local curdir
|
||||
local rc
|
||||
|
||||
curdir=$PWD
|
||||
cd $directory
|
||||
curdir="${PWD}"
|
||||
cd "${directory}" || { echo "Unable to change to ${directory}, exiting."; exit 1; }
|
||||
git status --short &> /dev/null
|
||||
rc=$?
|
||||
cd $curdir
|
||||
return $rc
|
||||
cd "${curdir}" || { echo "Unable to change to ${curdir}, exiting."; exit 1; }
|
||||
return "${rc}"
|
||||
}
|
||||
|
||||
prep_repo() {
|
||||
|
|
Loading…
Reference in a new issue