File tree
Expand file treeCollapse file tree1 file changed
+4
-3
lines changed Expand file treeCollapse file tree1 file changed
+4
-3
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -11,13 +11,14 @@ _sf_{{ COMMAND_NAME }}() {
|
11 | 11 | local sf_cmd="${COMP_WORDS[0]}"
|
12 | 12 |
|
13 | 13 | # for an alias, get the real script behind it
|
14 |
| -if [[ $(type -t $sf_cmd) == "alias" ]]; then |
| 14 | +sf_cmd_type=$(type -t $sf_cmd) |
| 15 | +if [[ $sf_cmd_type == "alias" ]]; then |
15 | 16 | sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/")
|
16 |
| -else |
| 17 | +elif [[ $sf_cmd_type == "file" ]]; then |
17 | 18 | sf_cmd=$(type -p $sf_cmd)
|
18 | 19 | fi
|
19 | 20 |
|
20 |
| -if [ ! -x "$sf_cmd" ]; then |
| 21 | +if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then |
21 | 22 | return 1
|
22 | 23 | fi
|
23 | 24 |
|
|
You can’t perform that action at this time.
0 commit comments