fix return on is_repo() function to stop it always returning 0

This commit is contained in:
Adam Warner 2016-11-02 09:28:36 +00:00
parent 45f04b8a11
commit fadb886d30
2 changed files with 18 additions and 2 deletions

View file

@ -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() {

View file

@ -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() {