mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-15 03:49:10 +00:00
cleanup and use sentintel in is_repo
This commit is contained in:
parent
d986746ef9
commit
c30478bf4a
1 changed files with 11 additions and 9 deletions
|
@ -33,15 +33,17 @@ getGitFiles() {
|
||||||
|
|
||||||
is_repo() {
|
is_repo() {
|
||||||
# Use git to check if directory is currently under VCS
|
# Use git to check if directory is currently under VCS
|
||||||
echo -n "::: Checking $1 is a repo..."
|
local directory="${1}"
|
||||||
cd "${1}" &> /dev/null || return 1
|
local gitRepo=0
|
||||||
if [[ $(git status --short) ]]; then
|
echo -n "::: Checking if ${directory} is a repo... "
|
||||||
echo " OK!"
|
cd "${directory}" &> /dev/null || return 1
|
||||||
return 0
|
if [[ $(git status --short > /dev/null) ]]; then
|
||||||
else
|
echo "OK"
|
||||||
echo " not found!"
|
else
|
||||||
return 1
|
echo "not found!"
|
||||||
fi
|
gitRepo=1
|
||||||
|
fi;
|
||||||
|
return ${gitRepo}
|
||||||
}
|
}
|
||||||
|
|
||||||
make_repo() {
|
make_repo() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue