@@ -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