1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +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

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