1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-17 10:02:19 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

4 Commits

Author SHA1 Message Date
sunnylqm
85db61704c v1.1.18 2020-10-18 12:16:35 +08:00
sunnylqm
57ddfc5d7d Add token when upload 2020-10-18 12:16:15 +08:00
sunnylqm
6cb38eeec1 v1.1.17 2020-10-13 18:12:35 +08:00
sunnylqm
8a7c21fb50 Do not throw update.json not found error 2020-10-13 18:12:15 +08:00
3 changed files with 11 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update-cli",
"version": "1.1.16",
"version": "1.1.18",
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
"main": "index.js",
"bin": {

View File

@@ -147,6 +147,10 @@ async function uploadFile(fn, key) {
realUrl,
{
formData,
headers: {
'User-Agent': userAgent,
'X-AccessToken': session ? session.token : '',
},
},
(err, resp, body) => {
if (err) {

View File

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