- 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)
28 lines
842 B
Bash
Executable File
28 lines
842 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
find-git-folder() {
|
|
if [[ -z "$1" ]]; then
|
|
echo '$1/path is empty.'
|
|
exit
|
|
fi
|
|
[[ ! -d "$1" ]] && { echo "Error: '$1' is not a directory." >&2; return 1; }
|
|
|
|
local excludes="${GIT_FOLDER_EXCLUDE:-.cache,node_modules,venv,__pycache__,.vim,.fzf,.password-store,.oh-my-zsh}"
|
|
local find_cmd="find \"$1\" -maxdepth 3"
|
|
|
|
IFS=',' read -ra patterns <<< "$excludes"
|
|
for pattern in "${patterns[@]}"; do
|
|
pattern=$(echo "$pattern" | xargs)
|
|
[[ -n "$pattern" ]] && find_cmd="$find_cmd \( -name '$pattern' -o -path \"*/$pattern/*\" \) -prune -o"
|
|
done
|
|
|
|
find_cmd="$find_cmd -type d -name '.git' -print"
|
|
|
|
eval "$find_cmd" 2>/dev/null | while IFS= read -r git_dir; do
|
|
[[ "$git_dir" != "./.git" ]] && dirname "$git_dir"
|
|
done
|
|
}
|
|
fgf() {
|
|
find-git-folder "$@"
|
|
}
|