mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Fix stf local not accepting multiple serials. Fixes #91.
This commit is contained in:
parent
b248e96dc2
commit
0942ecea7a
2 changed files with 5 additions and 18 deletions
15
lib/cli.js
15
lib/cli.js
|
@ -15,7 +15,7 @@ program
|
||||||
.version(pkg.version)
|
.version(pkg.version)
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('provider [serial..]')
|
.command('provider [serial...]')
|
||||||
.description('start provider')
|
.description('start provider')
|
||||||
.option('-s, --connect-sub <endpoint>'
|
.option('-s, --connect-sub <endpoint>'
|
||||||
, 'sub endpoint'
|
, 'sub endpoint'
|
||||||
|
@ -76,10 +76,7 @@ program
|
||||||
, 'whether to mute master volume when devices are being used')
|
, 'whether to mute master volume when devices are being used')
|
||||||
.option('--lock-rotation'
|
.option('--lock-rotation'
|
||||||
, 'whether to lock rotation when devices are being used')
|
, 'whether to lock rotation when devices are being used')
|
||||||
.action(function() {
|
.action(function(serials, options) {
|
||||||
var serials = cliutil.allUnknownArgs(arguments)
|
|
||||||
, options = cliutil.lastArg(arguments)
|
|
||||||
|
|
||||||
if (!options.connectSub) {
|
if (!options.connectSub) {
|
||||||
this.missingArgument('--connect-sub')
|
this.missingArgument('--connect-sub')
|
||||||
}
|
}
|
||||||
|
@ -862,7 +859,7 @@ program
|
||||||
})
|
})
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('local [serial..]')
|
.command('local [serial...]')
|
||||||
.description('start everything locally')
|
.description('start everything locally')
|
||||||
.option('--bind-app-pub <endpoint>'
|
.option('--bind-app-pub <endpoint>'
|
||||||
, 'app pub endpoint'
|
, 'app pub endpoint'
|
||||||
|
@ -972,10 +969,8 @@ program
|
||||||
, 'whether to mute master volume when devices are being used')
|
, 'whether to mute master volume when devices are being used')
|
||||||
.option('--lock-rotation'
|
.option('--lock-rotation'
|
||||||
, 'whether to lock rotation when devices are being used')
|
, 'whether to lock rotation when devices are being used')
|
||||||
.action(function() {
|
.action(function(serials, options) {
|
||||||
var log = logger.createLogger('cli:local')
|
var log = logger.createLogger('cli:local')
|
||||||
, args = arguments
|
|
||||||
, options = cliutil.lastArg(args)
|
|
||||||
, procutil = require('./util/procutil')
|
, procutil = require('./util/procutil')
|
||||||
|
|
||||||
// Each forked process waits for signals to stop, and so we run over the
|
// Each forked process waits for signals to stop, and so we run over the
|
||||||
|
@ -1040,7 +1035,7 @@ program
|
||||||
.concat(options.allowRemote ? ['--allow-remote'] : [])
|
.concat(options.allowRemote ? ['--allow-remote'] : [])
|
||||||
.concat(options.muteMaster ? ['--mute-master'] : [])
|
.concat(options.muteMaster ? ['--mute-master'] : [])
|
||||||
.concat(options.lockRotation ? ['--lock-rotation'] : [])
|
.concat(options.lockRotation ? ['--lock-rotation'] : [])
|
||||||
.concat(cliutil.allUnknownArgs(args)))
|
.concat(serials))
|
||||||
|
|
||||||
// auth
|
// auth
|
||||||
, procutil.fork(__filename, [
|
, procutil.fork(__filename, [
|
||||||
|
|
|
@ -7,14 +7,6 @@ module.exports.size = function(val) {
|
||||||
return match ? [+match[1], +match[2]] : undefined
|
return match ? [+match[1], +match[2]] : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.allUnknownArgs = function(args) {
|
|
||||||
return [].slice.call(args, 0, -1).filter(Boolean)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.lastArg = function(args) {
|
|
||||||
return args[args.length - 1]
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.range = function(from, to) {
|
module.exports.range = function(from, to) {
|
||||||
var items = []
|
var items = []
|
||||||
, i
|
, i
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue