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 (
3232
3333type  buildOptions  struct  {
3434	kustomizationPath  string 
35+ 	outputPath         string 
3536}
3637
3738// newCmdBuild creates a new build command. 
@@ -52,6 +53,10 @@ func newCmdBuild(out io.Writer, fs fs.FileSystem) *cobra.Command {
5253			return  o .RunBuild (out , fs )
5354		},
5455	}
56+ 	cmd .Flags ().StringVarP (
57+ 		& o .outputPath ,
58+ 		"output" , "o" , "" ,
59+ 		"If specified, write the build output to this path." )
5560	return  cmd 
5661}
5762
@@ -98,6 +103,10 @@ func (o *buildOptions) RunBuild(out io.Writer, fSys fs.FileSystem) error {
98103	if  err  !=  nil  {
99104		return  err 
100105	}
106+ 
107+ 	if  o .outputPath  !=  ""  {
108+ 		return  fSys .WriteFile (o .outputPath , res )
109+ 	}
101110	_ , err  =  out .Write (res )
102111	return  err 
103112}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments