Automatically fall back to listing all projects for edge cases
When in a directory under projects that is not indexes with git, listprojects would throw an error - it now falls back to listprojects --all
This commit is contained in:
parent
1e5bfc5eae
commit
e00aa68640
|
@ -16,8 +16,8 @@ listprojects() {
|
||||||
if test "$1" = "--all"
|
if test "$1" = "--all"
|
||||||
then find $projects_dir -mindepth 2 -maxdepth $projects_subfolder_level -type d -name ".git" | xargs dirname
|
then find $projects_dir -mindepth 2 -maxdepth $projects_subfolder_level -type d -name ".git" | xargs dirname
|
||||||
else
|
else
|
||||||
if test "$(echo $PWD | grep $projects_dir/)" -a ! -d ".git" && ! git rev-parse --git-dir > /dev/null 2>&1
|
if test "$(echo $PWD | grep $projects_dir/)" && ! git rev-parse --git-dir > /dev/null 2>&1
|
||||||
then find $PWD -mindepth 2 -maxdepth $projects_subfolder_level -type d -name ".git" | xargs dirname
|
then find $PWD -mindepth 2 -maxdepth $projects_subfolder_level -type d -name ".git" | xargs dirname 2> /dev/null || listprojects --all
|
||||||
else find $projects_dir -mindepth 2 -maxdepth $projects_subfolder_level -type d -not -path "*_*" -name ".git" | xargs dirname
|
else find $projects_dir -mindepth 2 -maxdepth $projects_subfolder_level -type d -not -path "*_*" -name ".git" | xargs dirname
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue