Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fjakobs committed Sep 4, 2024
1 parent 90d6490 commit e51037f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 0 additions & 7 deletions libs/template/materialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ func Materialize(ctx context.Context, configFilePath, templateRoot, outputDir st
return err
}

if outputDir == "" {
outputDir, err = os.Getwd()
if err != nil {
return err
}
}

templatePath := filepath.Join(templateRoot, templateDirName)
libraryPath := filepath.Join(templateRoot, libraryDirName)
schemaPath := filepath.Join(templateRoot, schemaFileName)
Expand Down
9 changes: 7 additions & 2 deletions libs/template/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,17 @@ func (r *renderer) computeFile(relPathTemplate string) (file, error) {
return nil, err
}

rootPath, err := filepath.Abs(r.instanceRoot)
if err != nil {
return nil, err
}

// If file name does not specify the `.tmpl` extension, then it is copied
// over as is, without treating it as a template
if !strings.HasSuffix(relPathTemplate, templateExtension) {
return &copyFile{
dstPath: &destinationPath{
root: r.instanceRoot,
root: rootPath,
relPath: relPath,
},
perm: perm,
Expand Down Expand Up @@ -196,7 +201,7 @@ func (r *renderer) computeFile(relPathTemplate string) (file, error) {
return &inMemoryFile{
ctx: r.ctx,
dstPath: &destinationPath{
root: r.instanceRoot,
root: rootPath,
relPath: relPath,
},
perm: perm,
Expand Down

0 comments on commit e51037f

Please sign in to comment.