Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Crepieux Pierre <[email protected]>
  • Loading branch information
pcrepieux committed Jun 1, 2021
1 parent bb1c20d commit 4a87878
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/cli/device/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports.builder = function(yargs) {
, default: process.env.SCREEN_JPEG_QUALITY || 80
})
.option('screen-grabber', {
describe: 'The tool to be used for screen capture. '+
describe: 'The tool to be used for screen capture. ' +
'Value must be either: minicap-bin (default) or minicap-apk'
, type: 'string'
, default: process.env.SCREEN_GRABBER || 'minicap-bin'
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module.exports.builder = function(yargs) {
, default: process.env.SCREEN_JPEG_QUALITY || 80
})
.option('screen-grabber', {
describe: 'The tool to be used for screen capture. '+
describe: 'The tool to be used for screen capture. ' +
'Value must be either: minicap-bin (default) or minicap-apk'
, type: 'string'
, default: process.env.SCREEN_GRABBER || 'minicap-bin'
Expand Down
6 changes: 3 additions & 3 deletions lib/units/device/plugins/screen/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = syrup.serial()
.dependency(require('./options'))
.define(function(options, adb, minicap, display, screenOptions) {
var log = logger.createLogger('device:plugins:screen:stream')
log.info("ScreenGrabber option set to %s", options.screenGrabber)
log.info('ScreenGrabber option set to %s', options.screenGrabber)

function FrameProducer(config, grabber) {
EventEmitter.call(this)
Expand Down Expand Up @@ -230,7 +230,7 @@ module.exports = syrup.serial()

FrameProducer.prototype._startService = function() {
log.info('Launching screen service %s', this.grabber)
return minicap.run(this.grabber,util.format(
return minicap.run(this.grabber, util.format(
'-S -Q %d -P %s'
, options.screenJpegQuality
, this.frameConfig.toString()
Expand Down Expand Up @@ -450,7 +450,7 @@ module.exports = syrup.serial()

return createServer()
.then(function(wss) {
log.info("creating FrameProducer: %s", options.screenGrabber)
log.info('creating FrameProducer: %s', options.screenGrabber)
var frameProducer = new FrameProducer(
new FrameConfig(display.properties, display.properties))
var broadcastSet = frameProducer.broadcastSet = new BroadcastSet()
Expand Down
13 changes: 8 additions & 5 deletions lib/units/device/resources/minicap.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ module.exports = syrup.serial()
, mode: 0755
})
, apk: new Resource({
src: pathutil.match([pathutil.module('@devicefarmer/minicap-prebuilt/prebuilt/noarch/minicap.apk')])
src: pathutil.match([pathutil.module(
'@devicefarmer/minicap-prebuilt/prebuilt/noarch/minicap.apk')])
, dest: ['/data/local/tmp/minicap.apk']
, comm: 'minicap.apk'
, mode: 0755
Expand Down Expand Up @@ -156,14 +157,16 @@ module.exports = syrup.serial()
, resources.bin.dest
, cmd
)
} else if(mode === 'minicap-apk' && resources.apk.src !== undefined ) {
runCmd = util.format(
}
else if(mode === 'minicap-apk' && resources.apk.src !== undefined) {
runCmd = util.format(
'CLASSPATH=%s app_process /system/bin io.devicefarmer.minicap.Main %s'
, resources.apk.dest
, cmd
)
} else {
log.error("Missing resources/unknown minicap grabber: %s", mode)
}
else {
log.error('Missing resources/unknown minicap grabber: %s', mode)
}
log.info(runCmd)
return adb.shell(options.serial, runCmd)
Expand Down
5 changes: 3 additions & 2 deletions lib/util/pathutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ module.exports.match = function(candidates) {

// Export
module.exports.requiredMatch = function(candidates) {
matched = this.match(candidates)
var matched = this.match(candidates)
if(matched !== undefined) {
return matched
} else {
}
else {
throw new Error(util.format(
'At least one of these paths should exist: %s'
, candidates.join(', ')
Expand Down

0 comments on commit 4a87878

Please sign in to comment.