1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

code changes to make ESLint happy

This commit is contained in:
song 2018-02-04 20:36:38 +08:00
parent fa50c56bb9
commit bf1283292e
2 changed files with 16 additions and 14 deletions

View file

@ -375,7 +375,7 @@ module.exports = syrup.serial()
} }
function kindKill() { function kindKill() {
return kill('SIGTERM') return kill('SIGTERM'
} }
function forceKill() { function forceKill() {

View file

@ -44,27 +44,29 @@ devutil.listPidsByComm = function(adb, serial, comm, bin) {
return new Promise(function(resolve) { return new Promise(function(resolve) {
if ('ps' in commands) { if ('ps' in commands) {
resolve(commands) resolve(commands)
} else { }
else {
adb.getProperties(serial) adb.getProperties(serial)
.then(function (properties) { .then(function(properties) {
version = properties['ro.build.version.release'] var version = properties['ro.build.version.release']
if (version.match(/^8\./) != null) { if (version.match(/^8\./) !== null) {
commands['ps'] = 'ps -lef' commands["ps"] = 'ps -lef'
} else { }
commands['ps'] = 'ps' else {
commands["ps"] = 'ps'
} }
resolve(commands) resolve(commands)
}) })
} }
}) })
.then(function (commands) { .then(function(commands) {
return adb.shell(serial, [commands['ps']]) return adb.shell(serial, [commands["ps"]])
.then(function (out) { .then(function(out) {
return new Promise(function (resolve) { return new Promise(function(resolve) {
var header = true var header = true
var pids = [] var pids = []
out.pipe(split()) out.pipe(split())
.on('data', function (chunk) { .on('data', function(chunk) {
if (header) { if (header) {
header = false header = false
} }
@ -75,7 +77,7 @@ devutil.listPidsByComm = function(adb, serial, comm, bin) {
} }
} }
}) })
.on('end', function () { .on('end', function() {
resolve(pids) resolve(pids)
}) })
}) })