Skip to content

Commit

Permalink
Normalize filename output (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoley13 authored Oct 23, 2024
1 parent c1a5395 commit 33e8221
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/handlers/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func writeTemplate(draftTemplate *Template, inputFile string) error {
}

func getOutputFileName(draftTemplate *Template, inputFile string) string {
outputName := strings.Replace(inputFile, draftTemplate.src, draftTemplate.dest, 1)
outputName := filepath.Clean(strings.Replace(inputFile, draftTemplate.src, draftTemplate.dest, 1))

fileName := filepath.Base(inputFile)
if overrideName, ok := draftTemplate.Config.FileNameOverrideMap[fileName]; ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestTemplateHandlerValidation(t *testing.T) {
templateName: "deployment-manifests",
fixturesBaseDir: "../fixtures/deployments/manifest",
version: "0.0.1",
dest: ".",
dest: "./validation/.././",
templateWriter: &writers.FileMapWriter{},
varMap: map[string]string{
"APPNAME": "testapp",
Expand Down

0 comments on commit 33e8221

Please sign in to comment.