mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 18:10:35 +07:00
gracefull shutdown for unresolvable errors
This commit is contained in:
@@ -2,6 +2,7 @@ package generation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"nto_cli/entities"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
@@ -9,10 +10,10 @@ import (
|
||||
)
|
||||
|
||||
func Generate(structName string, fields []entities.Field) {
|
||||
mkPath := fmt.Sprintf("%s/frontend/src/%s", utils.FindFrontendPath() , strings.ToLower(structName))
|
||||
mkPath := fmt.Sprintf("%s/frontend/src/%s", utils.FindFrontendPath(), strings.ToLower(structName))
|
||||
if err := os.Mkdir(mkPath, 0755); err != nil {
|
||||
panic(err)
|
||||
log.Fatalf("Failed to mkdir for model: %s", err)
|
||||
}
|
||||
GenerateService(structName, mkPath)
|
||||
GenerateScheme(structName, fields, mkPath)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user