1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
tdzl2003 2016-04-03 21:06:03 +08:00
parent 8a0d48dc62
commit 9fb15d76a5
2 changed files with 7 additions and 10 deletions

View File

@ -3,7 +3,7 @@
*/ */
const fetch = require('isomorphic-fetch'); const fetch = require('isomorphic-fetch');
let host = process.env.PUSHY_REGISTRY || 'http://pushy.reactnative.cn'; let host = process.env.PUSHY_REGISTRY || 'http://update.reactnative.cn';
const fs = require('fs-promise'); const fs = require('fs-promise');
import * as fsOrigin from 'fs'; import * as fsOrigin from 'fs';
import request from 'request'; import request from 'request';
@ -13,9 +13,9 @@ let session = undefined;
let savedSession = undefined; let savedSession = undefined;
exports.loadSession = async function() { exports.loadSession = async function() {
if (await fs.exists('.pushy')) { if (await fs.exists('.update')) {
try { try {
exports.replaceSession(JSON.parse(await fs.readFile('.pushy', 'utf8'))); exports.replaceSession(JSON.parse(await fs.readFile('.update', 'utf8')));
savedSession = session; savedSession = session;
} catch (e) { } catch (e) {
console.error('Failed to parse file `.pushy`. Try to remove it manually.'); console.error('Failed to parse file `.pushy`. Try to remove it manually.');
@ -37,14 +37,14 @@ exports.saveSession = async function(){
if (session !== savedSession) { if (session !== savedSession) {
const current = session; const current = session;
const data = JSON.stringify(current, null, 4); const data = JSON.stringify(current, null, 4);
await fs.writeFile('.pushy', data, 'utf8'); await fs.writeFile('.update', data, 'utf8');
savedSession = current; savedSession = current;
} }
} }
exports.closeSession = async function(){ exports.closeSession = async function(){
if (await fs.exists('.pushy')) { if (await fs.exists('.update')) {
await fs.unlink('.pushy'); await fs.unlink('.update');
savedSession = undefined; savedSession = undefined;
} }
session = undefined; session = undefined;

View File

@ -386,10 +386,7 @@ export const commands = {
process.exit(1); process.exit(1);
} }
await diffWithPackage(origin, next, realOutput, 'assets/index.android.bundle', v=>{ await diffWithPackage(origin, next, realOutput, 'assets/index.android.bundle');
const m = /^res\/(.+)$/.exec(v);
return m && m[1];
});
}, },
async diffWithIpa({args, options}) { async diffWithIpa({args, options}) {