Skip to content

Commit

Permalink
fix escaped antislashes in paths (windows only)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu JACQUOT committed May 20, 2019
1 parent 6426812 commit a9ddc3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion conf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ func (f *File) WriteRender(ctx map[string]interface{}, delims []string) error {
if fd, err = os.Create(f.NewPath + ".rendered"); err != nil {
return err
}
defer fd.Close()

if err = t.Execute(fd, ctx); err != nil {
fd.Close()
return err
}

fd.Close()
return os.Rename(rdr, f.NewPath)
}

Expand Down
2 changes: 1 addition & 1 deletion conf/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r Root) ExecuteCommands(dir string) {

// NewPath adds the path where the file should be rendered according to the root
func (r Root) NewPath(f *File, new string) {
f.NewPath = strings.Replace(f.Path, r.File.Dir, new, 1)
f.NewPath = filepath.ToSlash(strings.Replace(f.Path, r.File.Dir, new, 1))
}

// NewRootConfig will return the root configuration
Expand Down

0 comments on commit a9ddc3c

Please sign in to comment.