Skip to content

Commit

Permalink
fix lint problem - method complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
allaVolkov committed Feb 4, 2019
1 parent f069118 commit a5bc1ae
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions internal/artifacts/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,8 @@ func setManifestDesc(ep dir.ITargetArtifacts, targetPathGetter dir.ITargetPath,
return errors.Wrapf(err,
"failed to generate the manifest file when getting the %s module content type", mod.Name)
}
modulePath := getModulePath(mod, targetPathGetter)
if modulePath != "" {
moduleEntry := entry{
EntryName: mod.Name,
EntryPath: modulePath,
ContentType: contentType,
EntryType: moduleEntry,
}
entries = append(entries, moduleEntry)
}

entries = addModuleEntry(targetPathGetter, entries, mod, contentType)

if onlyModules {
continue
Expand All @@ -98,6 +90,21 @@ func setManifestDesc(ep dir.ITargetArtifacts, targetPathGetter dir.ITargetPath,
return genManifest(ep.GetManifestPath(), entries)
}

func addModuleEntry(targetPathGetter dir.ITargetPath, entries []entry, module *mta.Module, contentType string) []entry {
result := entries
modulePath := getModulePath(module, targetPathGetter)
if modulePath != "" {
moduleEntry := entry{
EntryName: module.Name,
EntryPath: modulePath,
ContentType: contentType,
EntryType: moduleEntry,
}
result = append(entries, moduleEntry)
}
return result
}

func getResourcesEntries(targetPathGetter dir.ITargetPath, resources []*mta.Resource,
contentTypes *contenttype.ContentTypes) ([]entry, error) {
var entries []entry
Expand Down

0 comments on commit a5bc1ae

Please sign in to comment.