- 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)
25 lines
767 B
Bash
Executable File
25 lines
767 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
ls-git-folder() {
|
|
if [[ -z "$1" ]]; then
|
|
echo '$1/filter is empty.' >&2
|
|
return 1
|
|
fi
|
|
|
|
if [[ ! -f ".gitmodules" ]]; then
|
|
# Fallback: search for .git folders in subdirectories up to depth 3
|
|
find . -maxdepth 3 -type d -name ".git" -not -path "./.git" -not -path "./node_modules/*" -not -path "./_site/*" | sed 's/\/.git$//' | sed 's|^\./||' | grep "^$1" | tr '\n' ' ' | sed 's/ $//' || true
|
|
return 0
|
|
fi
|
|
|
|
# Get submodule paths that start with filter, output space-separated
|
|
git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null \
|
|
| cut -d' ' -f2 \
|
|
| grep "^$1" \
|
|
| tr '\n' ' ' \
|
|
| sed 's/ $//'
|
|
}
|
|
lsgf() {
|
|
ls-git-folder "$@"
|
|
}
|