1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-17 21:46:09 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Bugfix: intermedia doesn't clear up between bundles.

This commit is contained in:
tdzl2003
2016-04-06 13:34:52 +08:00
parent 3c92baf1ed
commit c770f9f4fe
2 changed files with 16 additions and 2 deletions

View File

@@ -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'))([