This commit is contained in:
Max 2022-11-17 14:47:16 +08:00
parent e2b98ba745
commit fbdce4cc5b

View file

@ -229,7 +229,6 @@ func makeDirs(root string) error {
}
func makeInit(root string) error {
files := data.AssetNames()
// if the app.json exist ignore
file := filepath.Join("app.json")
@ -237,6 +236,7 @@ func makeInit(root string) error {
return nil
}
files := data.AssetNames()
for _, file := range files {
if strings.HasPrefix(file, "init/") {
dst := filepath.Join(root, strings.TrimPrefix(file, "init/"))
@ -245,6 +245,11 @@ func makeInit(root string) error {
return err
}
if _, err := os.Stat(dst); err == nil { // exists
log.Error("[setup] %s exists", dst)
continue
}
dir := filepath.Dir(dst)
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
return err