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

Do not throw update.json not found error

This commit is contained in:
sunnylqm
2020-10-13 18:12:15 +08:00
parent 7223fa1389
commit 8a7c21fb50

View File

@@ -68,10 +68,10 @@ export async function getApkInfo(fn) {
const updateJsonFile = await appInfoParser.parser.getEntry( const updateJsonFile = await appInfoParser.parser.getEntry(
/res\/raw\/update.json/, /res\/raw\/update.json/,
); );
if (!updateJsonFile) { let appCredential = {};
throw new Error('找不到update.json文件'); if (updateJsonFile) {
appCredential = JSON.parse(updateJsonFile.toString()).android;
} }
const appCredential = JSON.parse(updateJsonFile.toString()).android;
const { versionName, application } = await appInfoParser.parse(); const { versionName, application } = await appInfoParser.parse();
let buildTime = 0; let buildTime = 0;
if (Array.isArray(application.metaData)) { if (Array.isArray(application.metaData)) {
@@ -102,10 +102,10 @@ export async function getIpaInfo(fn) {
const updateJsonFile = await appInfoParser.parser.getEntry( const updateJsonFile = await appInfoParser.parser.getEntry(
/payload\/.+?\.app\/assets\/update.json/, /payload\/.+?\.app\/assets\/update.json/,
); );
if (!updateJsonFile) { let appCredential = {};
throw new Error('找不到update.json文件'); if (updateJsonFile) {
appCredential = JSON.parse(updateJsonFile.toString()).ios;
} }
const appCredential = JSON.parse(updateJsonFile.toString()).ios;
const { const {
CFBundleShortVersionString: versionName, CFBundleShortVersionString: versionName,
} = await appInfoParser.parse(); } = await appInfoParser.parse();