blueprint/creator/creator.go
Danil Solovyov 5f715016f0 basic
2023-12-19 11:45:28 +05:00

36 lines
560 B
Go

package creator
import (
"os"
"penahub.gitlab.yandexcloud.net/pena-services/bluepint/blueprint"
)
type Deps struct {
Blueprint *blueprint.BlueprintFile
}
type Creator struct {
blueprint *blueprint.BlueprintFile
}
func NewCreator(deps Deps) *Creator {
return &Creator{
blueprint: deps.Blueprint,
}
}
func (r *Creator) CreateApp() error {
return r.makeFolders()
}
func (r *Creator) makeFolders() error {
for _, folderPath := range r.blueprint.Folders {
if err := os.MkdirAll(folderPath, 0750); err != nil {
return err
}
}
return nil
}