Skip to content

Commit 0cbfca0

Browse files
authored
Introduce Options.Env (#11)
1 parent 0851428 commit 0cbfca0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

client/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/Southclaws/fault"
1212
"github.com/Southclaws/fault/fctx"
1313
"github.com/Southclaws/fault/fmsg"
14-
"github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
14+
remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
1515
"github.com/google/uuid"
1616
"google.golang.org/api/transport/bytestream"
1717
"google.golang.org/grpc"

cmd/cmd.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ type Options struct {
3737
BindAddr string
3838
// If true, the command will set TURBO_API, TURBO_TOKEN, and TURBO_TEAM variables (unless they are already set)
3939
AutoEnv bool
40+
// Additional environment overrides.
41+
Env []string
42+
4043
// If true, just run the command.
4144
Disabled bool
4245
// If remote cache connection or proxy server start fails, just run the command.
@@ -94,8 +97,13 @@ func Main(
9497
c.Stdout = os.Stdout
9598
c.Stderr = os.Stderr
9699

97-
if serverActuallyRuns && cmd.opts.AutoEnv {
98-
c.Env = cmd.turboEnvironment()
100+
if serverActuallyRuns {
101+
if cmd.opts.AutoEnv {
102+
c.Env = cmd.turboEnvironment()
103+
}
104+
if len(cmd.opts.Env) > 0 {
105+
c.Env = append(c.Env, cmd.opts.Env...)
106+
}
99107
}
100108
if err = c.Start(); err != nil {
101109
return 1, server.Stats{}, false, fault.Wrap(err, fmsg.With("error starting command"))

0 commit comments

Comments
 (0)