Skip to content

Commit

Permalink
Fix error on crew autocomplete (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
supechicken authored Dec 23, 2022
1 parent e517299 commit f2f5223
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bash.d/01-crew
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function _crew () {
--color
--no-color
--keep
--license
--license
--build-from-source
--recursive-build
--verbose
Expand Down Expand Up @@ -55,9 +55,9 @@ function _crew () {
# match ${current} with available packages
local matched_pkgs=( ${CREW_PACKAGES_PATH}/${current}*.rb )

if [[ ${#matched_pkgs[@]} != 0 ]]; then
# use ls and basename to remove extension and path
COMPREPLY=( $(ls -1 ${matched_pkgs[@]} | xargs basename -s .rb) )
if [[ ${#matched_pkgs[@]} > 1 ]]; then
# use basename to remove extension and path
COMPREPLY=( $(basename -s .rb ${matched_pkgs[@]}) )
else
return 1
fi
Expand Down

0 comments on commit f2f5223

Please sign in to comment.