@@ -295,18 +295,16 @@ func checkIfConfigExistsAndIsNeeded(toolName string, cliLocalMode bool) error {
295295 // Check if the config file exists
296296 if _ , err := os .Stat (toolConfigPath ); os .IsNotExist (err ) {
297297 // Only show error if we're in remote mode and need the config file
298- if ! cliLocalMode && initFlags .ApiToken != "" {
298+ if ( ! cliLocalMode && initFlags .ApiToken != "" ) || cliLocalMode {
299299 fmt .Printf ("Creating new config file for tool %s\n " , toolName )
300300 if err := configsetup .CreateToolConfigurationFile (toolName , initFlags ); err != nil {
301301 return fmt .Errorf ("failed to create config file for tool %s: %w" , toolName , err )
302302 }
303- } else if ! cliLocalMode {
304- fmt .Printf ("Config file not found for tool %s: %s and no API token provided\n " , toolName , toolConfigPath )
305303 } else {
306- fmt .Printf ("Config file not found for tool %s: %s. Please add a config file to the tools-configs directory \n " , toolName , toolConfigPath )
304+ fmt .Printf ("Config file not found for tool %s: %s and no API token provided \n " , toolName , toolConfigPath )
307305 }
308306 } else if err != nil {
309- return fmt .Errorf ("Error checking config file for tool %s: %w" , toolName , err )
307+ return fmt .Errorf ("error checking config file for tool %s: %w" , toolName , err )
310308 } else {
311309 fmt .Printf ("Config file found for %s: %s\n " , toolName , toolConfigPath )
312310 }
0 commit comments