Mkdir if dir not exists

This commit is contained in:
なるみ 2022-04-07 20:21:07 +08:00
parent 6c20ec3c85
commit 4e2faacbae

View File

@ -129,6 +129,13 @@ func BuildTarget(ctx context.Context, userConfig *Config, target BuildTargetConf
buildDir = "build"
}
if _, err := os.Stat(buildDir); os.IsNotExist(err) {
err = os.Mkdir(buildDir, 0777)
if err != nil {
return "", err
}
}
buildDir = filepath.Join(userConfig.Build.BuildDir, target.Name)
return Build(ctx, userConfig, target)
}