@@ -181,13 +181,13 @@ func processCommandAliases(
181
181
Run : func (cmd * cobra.Command , args []string ) {
182
182
err := cmd .ParseFlags (args )
183
183
if err != nil {
184
- u . LogErrorAndExit (err )
184
+ log . Fatal (err )
185
185
}
186
186
187
187
commandToRun := fmt .Sprintf ("%s %s %s" , os .Args [0 ], aliasCmd , strings .Join (args , " " ))
188
188
err = e .ExecuteShell (atmosConfig , commandToRun , commandToRun , currentDirPath , nil , false )
189
189
if err != nil {
190
- u . LogErrorAndExit (err )
190
+ log . Fatal (err )
191
191
}
192
192
},
193
193
}
@@ -337,13 +337,13 @@ func executeCustomCommand(
337
337
if fl .Type == "" || fl .Type == "string" {
338
338
providedFlag , err := flags .GetString (fl .Name )
339
339
if err != nil {
340
- u . LogErrorAndExit (err )
340
+ log . Fatal (err )
341
341
}
342
342
flagsData [fl .Name ] = providedFlag
343
343
} else if fl .Type == "bool" {
344
344
boolFlag , err := flags .GetBool (fl .Name )
345
345
if err != nil {
346
- u . LogErrorAndExit (err )
346
+ log . Fatal (err )
347
347
}
348
348
flagsData [fl .Name ] = boolFlag
349
349
}
@@ -362,7 +362,7 @@ func executeCustomCommand(
362
362
// Process Go templates in the command's 'component_config.component'
363
363
component , err := e .ProcessTmpl (fmt .Sprintf ("component-config-component-%d" , i ), commandConfig .ComponentConfig .Component , data , false )
364
364
if err != nil {
365
- u . LogErrorAndExit (err )
365
+ log . Fatal (err )
366
366
}
367
367
if component == "" || component == "<no value>" {
368
368
u .LogErrorAndExit (fmt .Errorf ("the command defines an invalid 'component_config.component: %s' in '%s'" ,
@@ -372,7 +372,7 @@ func executeCustomCommand(
372
372
// Process Go templates in the command's 'component_config.stack'
373
373
stack , err := e .ProcessTmpl (fmt .Sprintf ("component-config-stack-%d" , i ), commandConfig .ComponentConfig .Stack , data , false )
374
374
if err != nil {
375
- u . LogErrorAndExit (err )
375
+ log . Fatal (err )
376
376
}
377
377
if stack == "" || stack == "<no value>" {
378
378
u .LogErrorAndExit (fmt .Errorf ("the command defines an invalid 'component_config.stack: %s' in '%s'" ,
@@ -382,7 +382,7 @@ func executeCustomCommand(
382
382
// Get the config for the component in the stack
383
383
componentConfig , err := e .ExecuteDescribeComponent (component , stack , true , true , nil )
384
384
if err != nil {
385
- u . LogErrorAndExit (err )
385
+ log . Fatal (err )
386
386
}
387
387
data ["ComponentConfig" ] = componentConfig
388
388
}
@@ -399,29 +399,29 @@ func executeCustomCommand(
399
399
err = fmt .Errorf ("either 'value' or 'valueCommand' can be specified for the ENV var, but not both.\n " +
400
400
"Custom command '%s %s' defines 'value=%s' and 'valueCommand=%s' for the ENV var '%s'" ,
401
401
parentCommand .Name (), commandConfig .Name , value , valCommand , key )
402
- u . LogErrorAndExit (err )
402
+ log . Fatal (err )
403
403
}
404
404
405
405
// If the command to get the value for the ENV var is provided, execute it
406
406
if valCommand != "" {
407
407
valCommandName := fmt .Sprintf ("env-var-%s-valcommand" , key )
408
- res , err := e .ExecuteShellAndReturnOutput (atmosConfig , valCommand , valCommandName , currentDirPath , nil , false )
408
+ res , err := u .ExecuteShellAndReturnOutput (valCommand , valCommandName , currentDirPath , nil , false )
409
409
if err != nil {
410
- u . LogErrorAndExit (err )
410
+ log . Fatal (err )
411
411
}
412
412
value = strings .TrimRight (res , "\r \n " )
413
413
} else {
414
414
// Process Go templates in the values of the command's ENV vars
415
415
value , err = e .ProcessTmpl (fmt .Sprintf ("env-var-%d" , i ), value , data , false )
416
416
if err != nil {
417
- u . LogErrorAndExit (err )
417
+ log . Fatal (err )
418
418
}
419
419
}
420
420
421
421
envVarsList = append (envVarsList , fmt .Sprintf ("%s=%s" , key , value ))
422
422
err = os .Setenv (key , value )
423
423
if err != nil {
424
- u . LogErrorAndExit (err )
424
+ log . Fatal (err )
425
425
}
426
426
}
427
427
@@ -436,14 +436,14 @@ func executeCustomCommand(
436
436
// Steps support Go templates and have access to {{ .ComponentConfig.xxx.yyy.zzz }} Go template variables
437
437
commandToRun , err := e .ProcessTmpl (fmt .Sprintf ("step-%d" , i ), step , data , false )
438
438
if err != nil {
439
- u . LogErrorAndExit (err )
439
+ log . Fatal (err )
440
440
}
441
441
442
442
// Execute the command step
443
443
commandName := fmt .Sprintf ("%s-step-%d" , commandConfig .Name , i )
444
444
err = e .ExecuteShell (atmosConfig , commandToRun , commandName , currentDirPath , envVarsList , false )
445
445
if err != nil {
446
- u . LogErrorAndExit (err )
446
+ log . Fatal (err )
447
447
}
448
448
}
449
449
}
@@ -505,7 +505,7 @@ func checkAtmosConfig(opts ...AtmosValidateOption) {
505
505
506
506
atmosConfig , err := cfg .InitCliConfig (schema.ConfigAndStacksInfo {}, false )
507
507
if err != nil {
508
- u . LogErrorAndExit (err )
508
+ log . Fatal (err )
509
509
}
510
510
511
511
if vCfg .CheckStack {
@@ -525,7 +525,7 @@ func printMessageForMissingAtmosConfig(atmosConfig schema.AtmosConfiguration) {
525
525
fmt .Println ()
526
526
err := tuiUtils .PrintStyledText ("ATMOS" )
527
527
if err != nil {
528
- u . LogErrorAndExit (err )
528
+ log . Fatal (err )
529
529
}
530
530
531
531
// Check if we're in a git repo. Warn if not.
@@ -668,7 +668,7 @@ func getConfigAndStacksInfo(commandName string, cmd *cobra.Command, args []strin
668
668
669
669
info , err := e .ProcessCommandLineArgs (commandName , cmd , finalArgs , argsAfterDoubleDash )
670
670
if err != nil {
671
- u . LogErrorAndExit (err )
671
+ log . Fatal (err )
672
672
}
673
673
return info
674
674
}
0 commit comments