Skip to content

Commit dab84db

Browse files
authored
Merge pull request #128 from mbland/reorder-scripts-paths
path: Search `_GO_SCRIPTS_DIR` before plugin dirs
2 parents 96fe117 + 0c3932f commit dab84db

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/internal/path

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [[ "${#_GO_SEARCH_PATHS[@]}" -eq 0 ]]; then
1313
unset '_GO_PLUGINS_PATHS'
1414
fi
1515
fi
16-
_GO_SEARCH_PATHS+=("${_GO_PLUGINS_PATHS[@]}" "$_GO_SCRIPTS_DIR")
16+
_GO_SEARCH_PATHS+=("$_GO_SCRIPTS_DIR" "${_GO_PLUGINS_PATHS[@]}")
1717
fi
1818

1919
_@go.list_available_commands() {

tests/path/init-constants.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ teardown() {
3939

4040
local expected_paths=(
4141
"$_GO_ROOTDIR/libexec"
42-
"${plugin_bindirs[@]}"
43-
"$TEST_GO_SCRIPTS_DIR")
42+
"$TEST_GO_SCRIPTS_DIR"
43+
"${plugin_bindirs[@]}")
4444

4545
assert_line_equals 0 "_GO_PLUGINS_DIR: $TEST_GO_PLUGINS_DIR"
4646
assert_line_equals 1 \

tests/vars.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ quotify_expected() {
8686
"[2]=\"$TEST_GO_PLUGINS_DIR/plugin2/bin\"")
8787
local search_paths=("[0]=\"$TEST_GO_ROOTDIR/bin\""
8888
"[1]=\"$_GO_CORE_DIR/libexec\""
89-
"[2]=\"$TEST_GO_PLUGINS_DIR/plugin0/bin\""
90-
"[3]=\"$TEST_GO_PLUGINS_DIR/plugin1/bin\""
91-
"[4]=\"$TEST_GO_PLUGINS_DIR/plugin2/bin\""
92-
"[5]=\"$TEST_GO_SCRIPTS_DIR\"")
89+
"[2]=\"$TEST_GO_SCRIPTS_DIR\""
90+
"[3]=\"$TEST_GO_PLUGINS_DIR/plugin0/bin\""
91+
"[4]=\"$TEST_GO_PLUGINS_DIR/plugin1/bin\""
92+
"[5]=\"$TEST_GO_PLUGINS_DIR/plugin2/bin\"")
9393

9494
# Note that the `format` module imports `strings` and `validation`.
9595
local expected_modules=('[0]="module_0"'

0 commit comments

Comments
 (0)