Skip to content

Commit 8e34f9a

Browse files
committed
bug #47022 [Console] get full command path for command in search path (remicollet)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Console] get full command path for command in search path | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Working on composer 2.4.0RC1 will autocompletion When the command is in the search path, **-f** fails, so we need to switch to its full path ``` $ type -p ./composer ./composer $ type -p composer /usr/bin/composer ``` Commits ------- ae57aee [Console] get full command path for command in search path
2 parents 23506ce + ae57aee commit 8e34f9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Console/Resources/completion.bash

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ _sf_{{ COMMAND_NAME }}() {
1313
# for an alias, get the real script behind it
1414
if [[ $(type -t $sf_cmd) == "alias" ]]; then
1515
sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/")
16+
else
17+
sf_cmd=$(type -p $sf_cmd)
1618
fi
1719

18-
if [ ! -f "$sf_cmd" ]; then
20+
if [ ! -x "$sf_cmd" ]; then
1921
return 1
2022
fi
2123

0 commit comments

Comments
 (0)