File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,11 +198,25 @@ if [[ ! -d ".git" || -f ".git" ]]; then
198198
199199 # # Recursively search for git repositories
200200 PROJECT_DIRS=` find ${INCLUDE_LINKS} ${SEARCH_PATH} -maxdepth ${MAXDEPTH} -mindepth 0 -name .git`
201- else
201+ elif [[ -f " .git " || -d " .git " ]] ; then
202202 PROJECT_DIRS=(" ` pwd` /.git" )
203203fi
204204
205- # Foreach of the project directories
205+ # # if project directories is still empty
206+ # # we might be sitting inside a git repo
207+ if [[ -z ${PROJECT_DIRS} ]]; then
208+ ROOT_DIR_COMMAND=" git rev-parse --show-toplevel"
209+ PROJECT_ROOT=$( eval ${ROOT_DIR_COMMAND} 2> /dev/null )
210+
211+ if [[ -z ${PROJECT_ROOT} ]]; then
212+ echo " ${YELLOW} You must be inside a git repository!${NORMAL} "
213+ exit 0
214+ fi
215+
216+ PROJECT_DIRS=(" ${PROJECT_ROOT} /.git" )
217+ fi
218+
219+ # Foreach of the project directories, run the standup
206220for DIR in ${PROJECT_DIRS} ; do
207221 cd " ` dirname $DIR ` "
208222 CUR_DIR=` pwd`
You can’t perform that action at this time.
0 commit comments