File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import (
32
32
33
33
type buildOptions struct {
34
34
kustomizationPath string
35
+ outputPath string
35
36
}
36
37
37
38
// newCmdBuild creates a new build command.
@@ -52,6 +53,10 @@ func newCmdBuild(out io.Writer, fs fs.FileSystem) *cobra.Command {
52
53
return o .RunBuild (out , fs )
53
54
},
54
55
}
56
+ cmd .Flags ().StringVarP (
57
+ & o .outputPath ,
58
+ "output" , "o" , "" ,
59
+ "If specified, write the build output to this path." )
55
60
return cmd
56
61
}
57
62
@@ -98,6 +103,10 @@ func (o *buildOptions) RunBuild(out io.Writer, fSys fs.FileSystem) error {
98
103
if err != nil {
99
104
return err
100
105
}
106
+
107
+ if o .outputPath != "" {
108
+ return fSys .WriteFile (o .outputPath , res )
109
+ }
101
110
_ , err = out .Write (res )
102
111
return err
103
112
}
You can’t perform that action at this time.
0 commit comments