gg: sort duplicate entries

This commit is contained in:
Motiejus Jakštys 2024-06-21 08:58:16 +03:00
parent 9ef590ed51
commit 34ccb536e6

View File

@ -33,7 +33,7 @@ g() {
local pkg_candidates
local _gopath
_gopath=$(git rev-parse --show-toplevel)
pkg_candidates="$( (cd "$_gopath" && find . m3/src -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' | sort -u)"
echo "$pkg_candidates" | awk '{print length, $0 }' | sort -n | awk '{print $2}'
}
#