File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,16 @@ DEFAULT CONFIGURATION:
4646}
4747
4848func  prepareSubcommandWithGlobalFlags (command  * cli.Command ) {
49- 	command .Before  =  prepareWorkPathAndCustomConf ()
49+ 	command .Before  =  prepareWorkPathAndCustomConf (command . Before )
5050}
5151
5252// prepareWorkPathAndCustomConf wraps the Action to prepare the work path and custom config 
53- func  prepareWorkPathAndCustomConf () cli.BeforeFunc  {
53+ func  prepareWorkPathAndCustomConf (original  cli.BeforeFunc ) cli.BeforeFunc  {
54+ 	if  original  ==  nil  {
55+ 		original  =  func (ctx  context.Context , c  * cli.Command ) (context.Context , error ) {
56+ 			return  ctx , nil 
57+ 		}
58+ 	}
5459	return  func (ctx  context.Context , cmd  * cli.Command ) (context.Context , error ) {
5560		var  args  setting.ArgWorkPathAndCustomConf 
5661		if  cmd .IsSet ("work-path" ) {
@@ -63,7 +68,7 @@ func prepareWorkPathAndCustomConf() cli.BeforeFunc {
6368			args .CustomConf  =  cmd .String ("config" )
6469		}
6570		setting .InitWorkPathAndCommonConfig (os .Getenv , args )
66- 		return  ctx , nil 
71+ 		return  original ( ctx , cmd ) 
6772	}
6873}
6974
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments