Switch install plugin to send status codes instead of full strings.

This commit is contained in:
Simo Kinnunen
2014-04-03 19:15:26 +09:00
parent 3a84e249d6
commit 89260676a3

View File

@@ -57,7 +57,7 @@ module.exports = syrup.serial()
if (contentLength) {
// Progress 0% to 70%
sendProgress(
'Pushing app to the device'
'pushing_file'
, 70 * Math.max(0, Math.min(
70
, stats.bytesTransferred / contentLength
@@ -87,11 +87,11 @@ module.exports = syrup.serial()
}
// Progress 0%
sendProgress('Pushing app to the device', 0)
sendProgress('pushing_file', 0)
pushApp()
.then(function(apk) {
// Progress 80%
sendProgress('Installing app', 80)
sendProgress('installing_app', 80)
return adb.installRemote(options.serial, apk)
})
.timeout(10000)
@@ -103,7 +103,7 @@ module.exports = syrup.serial()
, message.launchActivity.component
)
// Progress 90%
sendProgress('Launching activity', 90)
sendProgress('launching_app', 90)
return adb.startActivity(options.serial, message.launchActivity)
}
})
@@ -115,7 +115,7 @@ module.exports = syrup.serial()
options.serial
, seq++
, true
, 'Installation complete'
, 'success'
))
])
})
@@ -127,7 +127,7 @@ module.exports = syrup.serial()
options.serial
, seq++
, false
, 'Installation failed'
, 'fail'
))
])
})