From 138a0c593462166a904eeac8d0011f3ecd2d3078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 Jun 2024 09:37:57 +0300 Subject: [PATCH] gg: add m3/src to search dirs --- shared/home/gg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/home/gg.sh b/shared/home/gg.sh index e305a98..3f58f30 100644 --- a/shared/home/gg.sh +++ b/shared/home/gg.sh @@ -33,7 +33,7 @@ g() { local pkg_candidates local _gopath _gopath=$(git rev-parse --show-toplevel) - pkg_candidates="$( (cd "$_gopath" && find . -mindepth 1 -maxdepth ${_GG_MAXDEPTH} -type d -path "*/$1" -and -not -path '*/vendor/*' -print) | sed 's/^\.\///g')" + pkg_candidates="$( (cd "$_gopath" && find . m3/src -mindepth 1 -maxdepth ${_GG_MAXDEPTH} -type d -path "*/$1" -and -not -path '*/vendor/*' -print) | sed 's/^\.\///g')" echo "$pkg_candidates" | awk '{print length, $0 }' | sort -n | awk '{print $2}' } # @@ -45,7 +45,7 @@ _g_complete() { cur="${COMP_WORDS[COMP_CWORD]}" local _gopath _gopath=$(git rev-parse --show-toplevel) - COMPREPLY=($(compgen -W "$(for f in $(find "$_gopath" -mindepth 1 -maxdepth ${_GG_MAXDEPTH} -type d -name "${cur}*" ! -name '.*' ! -path '*/.git/*' ! -path '*/test/*' ! -path '*/vendor/*'); do echo "${f##*/}"; done)" -- "$cur")) + COMPREPLY=($(compgen -W "$(for f in $(find "$_gopath" "${_gopath}/m3/src" -mindepth 1 -maxdepth ${_GG_MAXDEPTH} -type d -name "${cur}*" ! -name '.*' ! -path '*/.git/*' ! -path '*/test/*' ! -path '*/vendor/*'); do echo "${f##*/}"; done)" -- "$cur")) return 0 } complete -F _g_complete g