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

..

6 Commits

Author SHA1 Message Date
sunnylqm
a9dea5c188 v1.1.0 2020-03-18 16:06:20 +08:00
sunnylqm
83fe70f840 Revert "seperate key name"
This reverts commit a6477b4f0f.

# Conflicts:
#	src/package.js
2020-03-18 16:06:03 +08:00
sunnylqm
f1dd31cd56 v1.0.9 2020-03-16 19:10:33 +08:00
sunnylqm
a6477b4f0f seperate key name 2020-03-16 19:10:02 +08:00
sunnylqm
15b82b440e v1.0.8 2020-03-10 09:24:25 +08:00
sunnylqm
cc3f5dc093 Update build time hint 2020-03-10 09:23:47 +08:00
3 changed files with 8 additions and 5 deletions

View File

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

View File

@@ -101,7 +101,7 @@ exports.post = queryWithBody('POST');
exports.put = queryWithBody('PUT');
exports.doDelete = queryWithBody('DELETE');
async function uploadFile(fn) {
async function uploadFile(fn, key) {
const { url, backupUrl, formData } = await exports.post('/upload', {});
let realUrl = url;
@@ -112,7 +112,7 @@ async function uploadFile(fn) {
timeout: 1000,
});
// console.log({pingResult});
if (pingResult.avg > 150) {
if (isNaN(pingResult.avg) || pingResult.avg > 150) {
realUrl = backupUrl;
}
// console.log({realUrl});
@@ -127,6 +127,9 @@ async function uploadFile(fn) {
});
const info = await new Promise((resolve, reject) => {
if (key) {
formData.key = key;
}
formData.file = fs.createReadStream(fn);
formData.file.on('data', function(data) {

View File

@@ -66,7 +66,7 @@ export async function getApkInfo(fn) {
}
}
if (buildTime == 0) {
throw new Error('Can not get build time for this app.');
throw new Error('无法获取此包的编译时间戳。请更新react-native-update到最新版本后重新打包上传。');
}
return { versionName, buildTime };
}
@@ -86,7 +86,7 @@ export async function getIpaInfo(fn) {
);
}
if (!buildTimeTxtBuffer) {
throw new Error('Can not get build time for this app.');
throw new Error('无法获取此包的编译时间戳。请更新react-native-update到最新版本后重新打包上传。');
}
const buildTime = buildTimeTxtBuffer.toString().replace('\n', '');
return { versionName, buildTime };