added git submodule

This commit is contained in:
Bryan Ramos 2026-03-09 17:36:32 -04:00
parent 8ecfea2ef5
commit 46d6f2825f
5 changed files with 15 additions and 44 deletions

View file

@ -0,0 +1,24 @@
''
function cdg() {
if [[ $1 == "--help" ]]; then
echo "A simple utility for navigating to the root of a git repo"
return 0
fi
if [[ -n "$1" ]]; then
echo "Invalid command: $1. Try 'cdg --help'."
return 1
fi
local root_dir
root_dir=$(git rev-parse --show-toplevel 2>/dev/null)
local git_status=$?
if [ $git_status -ne 0 ]; then
echo "Error: Not a git repo."
return 1
fi
cd "$root_dir"
}
''