File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -134,13 +134,25 @@ func main() {
134134
135135	cli .CompletionOptions .HiddenDefaultCmd  =  true 
136136
137- 	// create a default profile if file does not exist 
138- 	if  _ , err  :=  config .ReadConfigFromFile (); os .IsNotExist (err ) {
137+ 		 // create a default profile if file does not exist 
138+ 	if  previousConfig , err  :=  config .ReadConfigFromFile (); os .IsNotExist (err ) {
139139		conf  :=  config.Config {
140140			Profiles :       map [string ]config.Profile {"demo" : defaultInitialProfile ()},
141141			DefaultProfile : "demo" ,
142142		}
143143		config .WriteConfigToFile (& conf )
144+ 	} else  {
145+ 		// updates the demo profile for existing users 
146+ 		_ , exists  :=  previousConfig .Profiles ["demo" ]
147+ 		if  exists  {
148+ 			conf  :=  config.Profile {
149+ 				URL :      "http://demo.parseable.com" ,
150+ 				Username : "admin" ,
151+ 				Password : "admin" ,
152+ 			}
153+ 			previousConfig .Profiles ["demo" ] =  conf 
154+ 			config .WriteConfigToFile (previousConfig )
155+ 		}
144156	}
145157
146158	err  :=  cli .Execute ()
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments