Files
cyper-mac/hosts/cyper-mac/shell-functions.sh
2025-12-26 11:02:58 +01:00

14 lines
274 B
Bash

# convenient shell functions
# quick navigation to git repo root
function cdroot() {
local root
root=$(git rev-parse --show-toplevel 2>/dev/null)
if [ $? -eq 0 ]; then
cd "$root"
else
echo "Not in a git repository"
return 1
fi
}