File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,15 @@ func (h *GazelleHost) loadStarzellePlugins(plugins []string) {
9696func (h * GazelleHost ) loadEnvStarzellePlugins () {
9797 builtinPlugins := []string {}
9898
99- // Load from cwd, or runfiles when running tests
99+ // Load relative to cwd by default
100100 builtinPluginDir , _ := os .Getwd ()
101+
101102 if os .Getenv ("BAZEL_TEST" ) != "" {
103+ // Load from runfiles when running in bazel tests
102104 builtinPluginDir = path .Join (os .Getenv ("RUNFILES_DIR" ), os .Getenv ("TEST_WORKSPACE" ))
105+ } else if workspaceDir := os .Getenv ("BUILD_WORKSPACE_DIRECTORY" ); workspaceDir != "" {
106+ // Load from bazel workspace root when run via bazel
107+ builtinPluginDir = workspaceDir
103108 }
104109
105110 // Comma-separated list of plugin paths relative to the workspace root
You can’t perform that action at this time.
0 commit comments