1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-11-22 16:26:10 +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; throw commandResult.error;
} }
} }
function emptyDir(dir) {
return new Promise((resolve) => {
fs.rmdir(dir, () => {
fs.mkdir(dir, resolve);
});
});
}
async function runReactNativeBundleCommand( async function runReactNativeBundleCommand(
bundleName, bundleName,
@@ -47,11 +54,7 @@ async function runReactNativeBundleCommand(
sourcemapOutput, sourcemapOutput,
config, config,
) { ) {
// empty output folder await emptyDir(outputFolder);
fs.unlink(outputFolder, () => {
fs.mkdir(outputFolder, () => {});
});
let reactNativeBundleArgs = []; let reactNativeBundleArgs = [];
let envArgs = process.env.PUSHY_ENV_ARGS; let envArgs = process.env.PUSHY_ENV_ARGS;