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

View File

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