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