Skip to content

Commit 35ee1f6

Browse files
committed
Refactor command builds
1 parent 33ea3fd commit 35ee1f6

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

hooks/jsonnet-fmt-hook/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ func execJsonnetFmt(f string, opts []string) error {
177177

178178
args := make([]string, 0, len(opts)+2)
179179
args = append(args, opts...)
180-
args = append(args, "--")
181-
args = append(args, f)
180+
args = append(args, []string{"--", f}...)
182181

183182
cmd := execabs.Command(jsonnetFmtCmd, args...)
184183
cmd.Stderr = &stderr

hooks/jsonnet-lint-hook/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ func execJsonnetLint(f string, opts []string) error {
3232

3333
args := make([]string, 0, len(opts)+2)
3434
args = append(args, opts...)
35-
args = append(args, "--")
36-
args = append(args, f)
35+
args = append(args, []string{"--", f}...)
3736
cmd := execabs.Command(jsonnetLintCmd, args...)
3837
cmd.Stderr = &stderr
3938
err := cmd.Run()

0 commit comments

Comments
 (0)