mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 17:10:34 +07:00
feat: path auto resolution
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package generation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"nto_cli/entities"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Generate(structName string, fields []entities.Field) {
|
||||
mkPath := fmt.Sprintf("%s/frontend/src/%s", utils.FindFrontendPath(), strings.ToLower(structName))
|
||||
mkPath := filepath.Join(utils.FindFrontendPath(), strings.ToLower(structName))
|
||||
if err := os.Mkdir(mkPath, 0755); err != nil {
|
||||
log.Fatalf("Failed to mkdir for model: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user