1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 09:41:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

empty dir

This commit is contained in:
sunnylqm
2020-05-29 13:11:59 +08:00
parent dfee2dd762
commit de68470060

View File

@@ -37,6 +37,13 @@ function exec(command) {
throw commandResult.error;
}
}
function emptyDir(dir) {
return new Promise((resolve) => {
fs.rmdir(dir, () => {
fs.mkdir(dir, resolve);
});
});
}
async function runReactNativeBundleCommand(
bundleName,
@@ -47,11 +54,7 @@ async function runReactNativeBundleCommand(
sourcemapOutput,
config,
) {
// empty output folder
fs.unlink(outputFolder, () => {
fs.mkdir(outputFolder, () => {});
});
await emptyDir(outputFolder);
let reactNativeBundleArgs = [];
let envArgs = process.env.PUSHY_ENV_ARGS;