Skip to content

Commit 3f9e80d

Browse files
authored
feat!: add options when creating RawCommand (testcontainers#3168)
1 parent 1720acd commit 3f9e80d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ type RawCommand struct {
311311
cmds []string
312312
}
313313

314-
func NewRawCommand(cmds []string) RawCommand {
314+
func NewRawCommand(cmds []string, opts ...tcexec.ProcessOption) RawCommand {
315315
return RawCommand{
316316
cmds: cmds,
317317
ExecOptions: ExecOptions{
318-
opts: []tcexec.ProcessOption{},
318+
opts: opts,
319319
},
320320
}
321321
}

options_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestWithStartupCommand(t *testing.T) {
146146
Started: true,
147147
}
148148

149-
testExec := testcontainers.NewRawCommand([]string{"touch", "/tmp/.testcontainers"})
149+
testExec := testcontainers.NewRawCommand([]string{"touch", ".testcontainers"}, exec.WithWorkingDir("/tmp"))
150150

151151
err := testcontainers.WithStartupCommand(testExec)(&req)
152152
require.NoError(t, err)

0 commit comments

Comments
 (0)