Compare commits

...

2 Commits

Author SHA1 Message Date
c0c8dd5eca Merge branch 'master' of github.com:flynx/git-utils 2024-10-03 16:09:32 +03:00
30b950db24 added -d to listall...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-10-03 16:08:09 +03:00
2 changed files with 21 additions and 2 deletions

View File

@ -12,6 +12,7 @@ while true ; do
echo "Options:" echo "Options:"
echo " -h --help - print this message and exit" echo " -h --help - print this message and exit"
echo " -r --recursive - list directories recursively" echo " -r --recursive - list directories recursively"
echo " -d --dirs-only - list directories only"
echo echo
echo "Repository list can be constructed from an existing set of repositories via:" echo "Repository list can be constructed from an existing set of repositories via:"
echo " $ git listall > reposiotry.lst" echo " $ git listall > reposiotry.lst"
@ -34,6 +35,12 @@ while true ; do
continue continue
;; ;;
-d|--dirs-only)
DIRS_ONLY=1
shift
continue
;;
-*|--*) -*|--*)
echo "Error: unknown option: \"$1\"" >&2 echo "Error: unknown option: \"$1\"" >&2
exit exit
@ -46,6 +53,17 @@ while true ; do
esac esac
done done
# prepare putput...
prep(){
if ! [ -z $DIRS_ONLY ] ; then
sed -e 's/=.*//'
else
cat
fi
}
TARGET_PATH=${TARGET_PATH:=.} TARGET_PATH=${TARGET_PATH:=.}
cd "$TARGET_PATH" cd "$TARGET_PATH"
@ -78,7 +96,8 @@ lines=()
fi fi
} \ } \
| sort \ | sort \
| uniq -u | uniq -u \
| prep

View File

@ -35,7 +35,7 @@ TARGET_PATH=${TARGET_PATH:=.}
cd "$TARGET_PATH" cd "$TARGET_PATH"
IFS=$'\n' IFS=$'\n'
DIRS=($(git listall ${RECURSIVE})) DIRS=($(git listall -d ${RECURSIVE}))
# inside a repo... # inside a repo...
if [ -d ./.git ] ; then if [ -d ./.git ] ; then