CreatePath creates the given directory in the projectPath
(pathToCreate string, projectPath string)
| 731 | |
| 732 | // CreatePath creates the given directory in the projectPath |
| 733 | func (p *Project) CreatePath(pathToCreate string, projectPath string) error { |
| 734 | path := filepath.Join(projectPath, pathToCreate) |
| 735 | if _, err := os.Stat(path); os.IsNotExist(err) { |
| 736 | err := os.MkdirAll(path, 0o751) |
| 737 | if err != nil { |
| 738 | log.Printf("Error creating directory %v\n", err) |
| 739 | return err |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | return nil |
| 744 | } |
| 745 | |
| 746 | // CreateFileWithInjection creates the given file at the |
| 747 | // project path, and injects the appropriate template |