Skip to content

Commit

Permalink
Refactor logging in ExecuteAtmosVendorInternal function (#730)
Browse files Browse the repository at this point in the history
* Refactor logging in ExecuteAtmosVendorInternal function

* Refactor logging in ExecuteAtmosVendorInternal function

* avoid unnecessary string operations when there are no tags

* Refactor logging in ExecuteAtmosVendorInternal function
  • Loading branch information
haitham911 authored Oct 20, 2024
1 parent c866ab5 commit 332a1a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/exec/vendor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ func ExecuteAtmosVendorInternal(
var uri string
vendorConfigFilePath := path.Dir(vendorConfigFileName)

u.LogInfo(cliConfig, fmt.Sprintf("Processing vendor config file '%s'", vendorConfigFileName))

logMessage := fmt.Sprintf("Processing vendor config file '%s'", vendorConfigFileName)
if len(tags) > 0 {
logMessage = fmt.Sprintf("%s for tags {%s}", logMessage, strings.Join(tags, ", "))
}
u.LogInfo(cliConfig, logMessage)
if len(atmosVendorSpec.Sources) == 0 && len(atmosVendorSpec.Imports) == 0 {
return fmt.Errorf("either 'spec.sources' or 'spec.imports' (or both) must be defined in the vendor config file '%s'", vendorConfigFileName)
}
Expand Down

0 comments on commit 332a1a9

Please sign in to comment.