Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-przybyl-wttech committed Aug 22, 2024
1 parent b67d822 commit 5cfb16f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const (
JCRRoot = "jcr_root"
JCRContentFile = ".content.xml"
JCRContentFileSuffix = ".xml"
XmlFileSuffix = ".xml"
JCRMixinTypesProp = "jcr:mixinTypes"
JCRRootPrefix = "<jcr:root"
PropPattern = "^\\s*([^ =]+)=\"([^\"]+)\"(.*)$"
Expand Down Expand Up @@ -156,7 +156,7 @@ func (c Manager) cleanDotContents(root string) error {
}

func (c Manager) cleanDotContentFile(path string) error {
if !strings.HasSuffix(path, JCRContentFileSuffix) {
if !strings.HasSuffix(path, XmlFileSuffix) {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/content_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (cm *ContentManager) Push(contentPath string, clean bool, packageOpts Packa

func determineCleanFile(file string) string {
if namespacePatternRegex.MatchString(file) && !strings.HasSuffix(file, content.JCRContentFile) {
return filepath.Join(strings.ReplaceAll(file, content.JCRContentFileSuffix, ""), content.JCRContentFile)
return filepath.Join(strings.ReplaceAll(file, content.XmlFileSuffix, ""), content.JCRContentFile)
}
return file
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/package_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ func DetermineFilterRoot(contentPath string) string {
filterRoot = strings.ReplaceAll(filterRoot, content.JCRContentFile, content.JCRContentNode)
} else if strings.HasSuffix(filterRoot, content.JCRContentFile) {
filterRoot = filepath.Dir(filterRoot)
} else if strings.HasSuffix(filterRoot, content.JCRContentFileSuffix) {
filterRoot = strings.ReplaceAll(filterRoot, content.JCRContentFileSuffix, "")
} else if strings.HasSuffix(filterRoot, content.XmlFileSuffix) {
filterRoot = strings.ReplaceAll(filterRoot, content.XmlFileSuffix, "")
}
filterRoot = namespacePatternRegex.ReplaceAllString(filterRoot, "/$2:")
filterRoot = strings.ReplaceAll(filterRoot, "/__", "/_")
Expand Down

0 comments on commit 5cfb16f

Please sign in to comment.