vgo - create directory

This commit is contained in:
jharshman 2019-01-29 19:11:26 -08:00 committed by Steve Francia
parent 17dc9f8142
commit 69420a9ffa
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,9 @@ Init will not use an existing directory with contents.`,
} }
// create cmd/root.go // create cmd/root.go
if _, err = os.Stat(fmt.Sprintf("%s/cmd", project.AbsolutePath)); os.IsNotExist(err) {
os.Mkdir("cmd", 0751)
}
rootFile, err := os.Create(fmt.Sprintf("%s/cmd/root.go", project.AbsolutePath)) rootFile, err := os.Create(fmt.Sprintf("%s/cmd/root.go", project.AbsolutePath))
if err != nil { if err != nil {
er(err) er(err)