mirror of
https://github.com/spf13/cobra
synced 2024-11-16 18:57:08 +00:00
vgo - create directory
This commit is contained in:
parent
17dc9f8142
commit
69420a9ffa
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue