support no-interaction usage.
This commit is contained in:
parent
de3ea04239
commit
67773c458a
@ -150,6 +150,8 @@
|
||||
}
|
||||
},
|
||||
"globalOptions":{
|
||||
|
||||
"no-interactive": {
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,6 @@ export const commands = {
|
||||
},
|
||||
selectApp: async function({args, options}) {
|
||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
||||
checkPlatform(platform || await question('Platform(ios/android):'));
|
||||
const id = args[0] || (await chooseApp(platform)).id;
|
||||
|
||||
let updateInfo = {};
|
||||
|
@ -24,6 +24,7 @@ const commands = {
|
||||
|
||||
exports.run = function () {
|
||||
const argv = require('cli-arguments').parse(require('../cli.json'));
|
||||
global.NO_INTERACTIVE = argv.options['no-interactive'];
|
||||
|
||||
loadSession()
|
||||
.then(()=>commands[argv.command](argv))
|
||||
@ -33,5 +34,6 @@ exports.run = function () {
|
||||
return;
|
||||
}
|
||||
console.error(err.message);
|
||||
process.exit(-1);
|
||||
});
|
||||
};
|
||||
|
@ -52,11 +52,11 @@ export const commands = {
|
||||
|
||||
const {hash} = await uploadFile(fn);
|
||||
|
||||
await post(`/app/${appId}/package/create`, {
|
||||
const {id} = await post(`/app/${appId}/package/create`, {
|
||||
name,
|
||||
hash,
|
||||
});
|
||||
console.log('Ok.');
|
||||
console.log('Ipa uploaded: id');
|
||||
},
|
||||
uploadApk: async function({args}) {
|
||||
const fn = args[0];
|
||||
@ -68,11 +68,11 @@ export const commands = {
|
||||
|
||||
const {hash} = await uploadFile(fn);
|
||||
|
||||
await post(`/app/${appId}/package/create`, {
|
||||
const {id} = await post(`/app/${appId}/package/create`, {
|
||||
name,
|
||||
hash,
|
||||
});
|
||||
console.log('Ok.');
|
||||
console.log('Apk uploaded: id');
|
||||
},
|
||||
packages: async function({options}) {
|
||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
||||
|
@ -10,6 +10,9 @@ import ipaMetadata from 'ipa-metadata';
|
||||
var read = require('read');
|
||||
|
||||
export function question(query, password) {
|
||||
if (NO_INTERACTIVE){
|
||||
return Promise.resolve('');
|
||||
}
|
||||
return new Promise((resolve, reject)=>read({
|
||||
prompt: query,
|
||||
silent: password,
|
||||
|
@ -86,7 +86,7 @@ export const commands = {
|
||||
description: description || await question('Enter description:'),
|
||||
metaInfo: metaInfo || await question('Enter meta info:'),
|
||||
});
|
||||
console.log('Ok.');
|
||||
console.log(`Version published: ${id}`);
|
||||
|
||||
const v = await question('Would you like to bind packages to this version?(Y/N)');
|
||||
if (v.toLowerCase() === 'y') {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "1.1.1",
|
||||
"version": "2.0.1",
|
||||
"description": "react-native hot update",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user