mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
Do not throw update.json not found error
This commit is contained in:
@@ -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();
|
||||||
|
Reference in New Issue
Block a user