mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
fix return on is_repo() function to stop it always returning 0
This commit is contained in:
parent
45f04b8a11
commit
fadb886d30
2 changed files with 18 additions and 2 deletions
|
@ -47,7 +47,15 @@ is_repo() {
|
|||
# Use git to check if directory is currently under VCS
|
||||
echo -n "::: Checking $1 is a repo..."
|
||||
cd "${1}" &> /dev/null || return 1
|
||||
git status &> /dev/null && echo " OK!"; return 0 || echo " not found!"; return 1
|
||||
git status &> /dev/null
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
echo " OK!"
|
||||
return 0
|
||||
else
|
||||
echo " not found!"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
make_repo() {
|
||||
|
|
|
@ -759,7 +759,15 @@ is_repo() {
|
|||
# Use git to check if directory is currently under VCS
|
||||
echo -n "::: Checking $1 is a repo..."
|
||||
cd "${1}" &> /dev/null || return 1
|
||||
git status &> /dev/null && echo " OK!"; return 0 || echo " not found!"; return 1
|
||||
git status &> /dev/null
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
echo " OK!"
|
||||
return 0
|
||||
else
|
||||
echo " not found!"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
make_repo() {
|
||||
|
|
Loading…
Reference in a new issue