use mewn for templates

massively improve template handling
This commit is contained in:
Lea Anthony
2019-03-02 12:54:10 +11:00
parent c20aabc8f8
commit c180d7dccb
10 changed files with 226 additions and 315 deletions

View File

@@ -41,6 +41,12 @@ func (fs *FSHelper) FileExists(path string) bool {
return fi.Mode().IsRegular()
}
func (fs *FSHelper) CreateFile(filename string, data []byte) error {
// Ensure directory exists
fs.MkDirs(filepath.Dir(filename))
return ioutil.WriteFile(filename, data, 0644)
}
// MkDirs creates the given nested directories.
// Returns error on failure
func (fs *FSHelper) MkDirs(fullPath string, mode ...os.FileMode) error {