generate project templates for python or go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
541 B

package main
import (
"os"
"path/filepath"
)
func createDir(fpath string) error {
if err := os.Mkdir(filepath.Dir(fpath + string(filepath.Separator)), 0770); err != nil {
return err
}
return nil
}
// for generating the project blanks
func createFile(fpath string) error {
// create directory automatically, if non-existent
if err := os.MkdirAll(filepath.Dir(fpath), 0770); err != nil {
return err
}
//create the file, but that's all
file, err := os.Create(fpath)
if err != nil {
return err
}
file.Close()
return nil
}