throw error if search path is not a directroy

This commit is contained in:
Denis Lehmann 2025-02-06 07:24:36 +01:00
parent 582eb2508b
commit 338ebe9e0f

4
gis
View file

@ -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