Skip to content

Commit 603108d

Browse files
fetching default configs in local mode
1 parent 9f60591 commit 603108d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/analyze.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,16 @@ func checkIfConfigExistsAndIsNeeded(toolName string, cliLocalMode bool) error {
297297
// Check if the config file exists
298298
if _, err := os.Stat(toolConfigPath); os.IsNotExist(err) {
299299
// Only show error if we're in remote mode and need the config file
300-
if !cliLocalMode && initFlags.ApiToken != "" {
300+
if (!cliLocalMode && initFlags.ApiToken != "") || cliLocalMode {
301301
fmt.Printf("Creating new config file for tool %s\n", toolName)
302302
if err := configsetup.CreateToolConfigurationFile(toolName, initFlags); err != nil {
303303
return fmt.Errorf("failed to create config file for tool %s: %w", toolName, err)
304304
}
305-
} else if !cliLocalMode {
306-
fmt.Printf("Config file not found for tool %s: %s and no API token provided\n", toolName, toolConfigPath)
307305
} else {
308-
fmt.Printf("Config file not found for tool %s: %s. Please add a config file to the tools-configs directory\n", toolName, toolConfigPath)
306+
fmt.Printf("Config file not found for tool %s: %s and no API token provided\n", toolName, toolConfigPath)
309307
}
310308
} else if err != nil {
311-
return fmt.Errorf("Error checking config file for tool %s: %w", toolName, err)
309+
return fmt.Errorf("error checking config file for tool %s: %w", toolName, err)
312310
} else {
313311
fmt.Printf("Config file found for %s: %s\n", toolName, toolConfigPath)
314312
}

0 commit comments

Comments
 (0)