File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 3636
3737if [ " $1 " = " show" ]; then
3838 # Show mode - display latest tags
39- echo -e " ${YELLOW} [tag-all]${NC} Showing latest tags:"
39+ echo -e " ${YELLOW} [tag-all]${NC} Repository tags:"
4040 echo
4141
42- # Show root repo tag
43- echo -e " ${GREEN} Root repository:${NC} "
44- LATEST_TAG=$( git describe --tags --abbrev=0 2> /dev/null || echo " No tags found" )
45- echo " Latest tag: $LATEST_TAG "
46- echo
42+ # Get the directory where the script is located and go to repo root
43+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
44+ cd " $SCRIPT_DIR /.."
45+
46+ # Collect all repo info
47+ REPO_INFO=" "
4748
48- # Show submodule tags
49+ # Add root repo
50+ LATEST_TAG=$( git describe --tags --abbrev=0 2> /dev/null || echo " No tags" )
51+ REPO_INFO=" ${REPO_INFO} trueblocks-core|${LATEST_TAG} \n"
52+
53+ # Add submodules
4954 SUBMODULES=$( git submodule status | awk ' {print $2}' )
5055 if [ -n " $SUBMODULES " ]; then
51- echo -e " ${GREEN} Submodules:${NC} "
5256 for SUBMODULE in $SUBMODULES ; do
5357 if [ -d " $SUBMODULE " ]; then
5458 cd " $SUBMODULE " || continue
55- LATEST_TAG=$( git describe --tags --abbrev=0 2> /dev/null || echo " No tags found " )
56- echo " $ SUBMODULE: $ LATEST_TAG"
59+ LATEST_TAG=$( git describe --tags --abbrev=0 2> /dev/null || echo " No tags" )
60+ REPO_INFO= " ${REPO_INFO}${ SUBMODULE} | ${ LATEST_TAG} \n "
5761 cd " $SCRIPT_DIR /.." || exit 1
5862 fi
5963 done
6064 fi
65+
66+ # Print table with aligned columns
67+ echo -e " $REPO_INFO " | column -t -s ' |'
6168 exit 0
6269fi
6370
You can’t perform that action at this time.
0 commit comments