Bugfix: intermedia doesn't clear up between bundles.
This commit is contained in:
parent
3c92baf1ed
commit
c770f9f4fe
@ -4,6 +4,7 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { mkdir as mkdirRecurisve } from 'mkdir-recursive';
|
||||
import rmdirRecursive from 'rimraf';
|
||||
import {
|
||||
getRNVersion,
|
||||
translateOptions,
|
||||
@ -28,6 +29,18 @@ function mkdir(dir){
|
||||
});
|
||||
}
|
||||
|
||||
function rmdir(dir) {
|
||||
return new Promise((resolve, reject) => {
|
||||
rmdirRecursive(dir, err => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function pack(dir, output){
|
||||
await mkdir(path.dirname(output));
|
||||
await new Promise((resolve, reject) => {
|
||||
@ -199,6 +212,7 @@ async function diffWithPPK(origin, next, output) {
|
||||
|
||||
for (var k in originEntries) {
|
||||
if (!newEntries[k]) {
|
||||
console.log('Delete '+k);
|
||||
deletes[k] = 1;
|
||||
}
|
||||
}
|
||||
@ -332,12 +346,11 @@ export const commands = {
|
||||
throw new Error('Platform must be specified.');
|
||||
}
|
||||
|
||||
await mkdir(intermediaDir);
|
||||
|
||||
const { version, major, minor } = getRNVersion();
|
||||
|
||||
console.log('Bundling with React Native version: ', version);
|
||||
|
||||
await rmdir(intermediaDir);
|
||||
await mkdir(intermediaDir);
|
||||
|
||||
require(path.resolve('node_modules/react-native/packager/babelRegisterOnly'))([
|
||||
|
@ -37,6 +37,7 @@
|
||||
"progress": "^1.1.8",
|
||||
"read": "^1.0.7",
|
||||
"request": "^2.69.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"yauzl": "^2.4.1",
|
||||
"yazl": "^2.3.0"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user