fix return on is_repo() function to stop it always returning 0
This commit is contained in:
parent
45f04b8a11
commit
fadb886d30
|
@ -47,7 +47,15 @@ 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..."
|
echo -n "::: Checking $1 is a repo..."
|
||||||
cd "${1}" &> /dev/null || return 1
|
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() {
|
make_repo() {
|
||||||
|
|
|
@ -759,7 +759,15 @@ 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..."
|
echo -n "::: Checking $1 is a repo..."
|
||||||
cd "${1}" &> /dev/null || return 1
|
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() {
|
make_repo() {
|
||||||
|
|
Loading…
Reference in New Issue