Fix problems on windows ()

This commit is contained in:
Antonio Navarro Perez 2021-11-18 11:36:07 -08:00 committed by GitHub
parent df7f1ce8be
commit 66eadf35dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 28 deletions

View file

@ -4,7 +4,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"github.com/distribyted/distribyted"
"github.com/rs/zerolog/log"
@ -34,7 +34,7 @@ func (c *Handler) createFromTemplateFile() ([]byte, error) {
return nil, err
}
if err := os.MkdirAll(path.Dir(c.p), 0744); err != nil {
if err := os.MkdirAll(filepath.Dir(c.p), 0744); err != nil {
return nil, fmt.Errorf("error creating path for configuration file: %s, %w", c.p, err)
}
return tb, ioutil.WriteFile(c.p, tb, 0644)