- Added alias functions to all bin scripts using first-letter pattern (e.g., `av` for `activate-venv`, `cwl` for `commit-with-llm`) - Implemented collision resolution by extending aliases with additional letters when conflicts occur or when shadowing standard shell commands - Documented alias implementation approach in library.md with complete alias map for reference - Verified shell syntax with `bash -n` and ensured proper argument passing with `"$@"` - Updated prompt frontmatter to reflect completed state and model used (infomaniak/moonshotai/Kimi-K2.6)
30 lines
1004 B
Bash
Executable File
30 lines
1004 B
Bash
Executable File
#!/bin/bash
|
|
|
|
list-git-folder() {
|
|
if [[ -z "$1" ]]; then
|
|
echo '$1/path is empty.'
|
|
exit
|
|
fi
|
|
|
|
# Define column widths
|
|
local path_width=35
|
|
local url_width=50
|
|
local branch_width=8
|
|
|
|
# Print table header
|
|
printf "| %-${path_width}s | %-${url_width}s | %-${branch_width}s |\n" "PATH" "URL" "BRANCH"
|
|
echo "|$(printf '%*s' $((path_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((url_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((branch_width + 2)) '' | tr ' ' '-')|"
|
|
|
|
local git_folders=$(ls-git-folder "$1")
|
|
for git_folder in $git_folders; do
|
|
local url=$(git config --file .gitmodules --get "submodule.$git_folder.url")
|
|
url=${url#git@github.com:}
|
|
url=${url%.git}
|
|
local branch=$(git -C "$git_folder" branch --show-current 2>/dev/null || echo "detached")
|
|
printf "| %-${path_width}s | %-${url_width}s | %-${branch_width}s |\n" "$git_folder" "$url" "${branch:-detached}"
|
|
done
|
|
}
|
|
lgf() {
|
|
list-git-folder "$@"
|
|
}
|