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

Add acc option

This commit is contained in:
sunnylqm
2021-09-01 14:54:17 +08:00
parent 25cb724921
commit 6f3d45c3f2
2 changed files with 12 additions and 7 deletions

View File

@@ -119,6 +119,9 @@ async function uploadFile(fn, key) {
let realUrl = url;
if (backupUrl) {
if (global.USE_ACC_OSS) {
realUrl = backupUrl;
} else {
const pingResult = await tcpPing({
address: url.replace('https://', ''),
attempts: 4,
@@ -128,6 +131,7 @@ async function uploadFile(fn, key) {
if (isNaN(pingResult.avg) || pingResult.avg > 150) {
realUrl = backupUrl;
}
}
// console.log({realUrl});
}

View File

@@ -36,6 +36,7 @@ function run() {
const argv = require('cli-arguments').parse(require('../cli.json'));
global.NO_INTERACTIVE = argv.options['no-interactive'];
global.USE_ACC_OSS = argv.options['acc'];
loadSession()
.then(()=>commands[argv.command](argv))