Skip to content

Commit

Permalink
fix: create crud dir along with necessary parents (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
namit-chandwani authored Jul 29, 2021
1 parent 25a1b0a commit 6f6f078
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/cmd/crud/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ func generateCrudFiles() error {
crudDirPath := flagVars.path + "/crud"

// Creates a directory using value in the `crudDirPath` variable
if _, err := os.Stat(crudDirPath); os.IsNotExist(err) {
err := os.Mkdir(crudDirPath, 0755)
if err != nil {
return err
}
err := os.MkdirAll(crudDirPath, 0755)
if err != nil {
return err
}

// Generates CRUD files in the `crud` directory by looping through the template files
err := fs.WalkDir(crud.CrudTemplates, ".", func(path string, info fs.DirEntry, err error) error {
err = fs.WalkDir(crud.CrudTemplates, ".", func(path string, info fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down

0 comments on commit 6f6f078

Please sign in to comment.