Skip to content
Permalink
Browse files

Merge pull request #1 from err0r500/master

fix escaped antislashes in paths (windows only)
  • Loading branch information...
Depado committed May 21, 2019
2 parents 6426812 + a9ddc3c commit 2c9f6cece57ba7205c4a85973843df1584bbf395
Showing with 4 additions and 2 deletions.
  1. +3 −1 conf/file.go
  2. +1 −1 conf/root.go
@@ -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)
}

@@ -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

0 comments on commit 2c9f6ce

Please sign in to comment.
You can’t perform that action at this time.