Skip to content

Commit e45e42f

Browse files
Prepend arg for defaults-file
1 parent 7384f1a commit e45e42f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sdk/provision/file_provisioner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (p FileProvisioner) Provision(ctx context.Context, in sdk.ProvisionInput, o
159159
argsResolved[i] = result.String()
160160
}
161161

162-
out.AddArgs(argsResolved...)
162+
out.PrependArgs(argsResolved...)
163163
}
164164
}
165165

sdk/provisioner.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"path/filepath"
7+
"slices"
78
"time"
89
)
910

@@ -107,6 +108,11 @@ func (out *ProvisionOutput) AddArgs(args ...string) {
107108
out.CommandLine = append(out.CommandLine, args...)
108109
}
109110

111+
// PrependArgs can be used to insert additional arguments at the beginning of the command line of the provision output.
112+
func (out *ProvisionOutput) PrependArgs(args ...string) {
113+
out.CommandLine = slices.Insert(out.CommandLine, 1, args...)
114+
}
115+
110116
// AddSecretFile can be used to add a file containing secrets to the provision output.
111117
func (out *ProvisionOutput) AddSecretFile(path string, contents []byte) {
112118
out.AddFile(path, OutputFile{

0 commit comments

Comments
 (0)