diff --git a/enterprise/server/cmd/ci_runner/main.go b/enterprise/server/cmd/ci_runner/main.go index e77c9b9d32e..e036f889302 100644 --- a/enterprise/server/cmd/ci_runner/main.go +++ b/enterprise/server/cmd/ci_runner/main.go @@ -265,6 +265,9 @@ func provisionArtifactsDir(ws *workspace, bazelCommandIndex int) error { func provisionKythe(ctx context.Context, ws *workspace) error { kytheRootPath := filepath.Join(ws.rootDir, kytheDirName) + if err := os.Setenv(kytheDirEnvVarName, kytheRootPath); err != nil { + return err + } if _, err := os.Stat(kytheRootPath); err == nil { return nil // dir already exists; we're done. } @@ -276,9 +279,6 @@ func provisionKythe(ctx context.Context, ws *workspace) error { if err := runCommand(ctx, "bash", args, nil /*=env*/, "" /*=dir*/, ws.log); err != nil { return err } - if err := os.Setenv(kytheDirEnvVarName, kytheRootPath); err != nil { - return err - } return nil }