throw error if search path is not a directroy
This commit is contained in:
parent
582eb2508b
commit
338ebe9e0f
1 changed files with 4 additions and 0 deletions
4
gis
4
gis
|
|
@ -89,6 +89,10 @@ fi
|
|||
# Find Git repositories
|
||||
git_dirs=()
|
||||
for path in "${paths[@]}"; do
|
||||
# Throw error if search path is not a directory
|
||||
[ ! -d "$path" ] && error "Search path ${text_bold}${path}${text_reset} is not a directory"
|
||||
|
||||
# Find all Git repositories
|
||||
OLDIFS=$IFS
|
||||
IFS=$'\n' read -r -d '' -a found_git_dirs < <(find "$path" -type d -name ".git" -exec dirname {} \; | sort)
|
||||
IFS=$OLDIFS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue