Remove remote files before installing, it seems to work more reliably (less "text busy").

This commit is contained in:
Simo Kinnunen
2014-03-17 16:45:31 +09:00
parent ccef3624df
commit 9c50c1bcdc

View File

@@ -34,6 +34,14 @@ module.exports = syrup()
}
}
function removeResource(res) {
return adb.shell(options.serial, ['rm', res.dest])
.then(function(out) {
return streamutil.readAll(out)
})
.return(res)
}
function installResource(res) {
return adb.push(options.serial, res.src, res.dest, res.mode)
.then(function(transfer) {
@@ -65,8 +73,8 @@ module.exports = syrup()
function installAll() {
return Promise.all([
installResource(resources.bin).then(ensureNotBusy)
, installResource(resources.lib)
removeResource(resources.bin).then(installResource).then(ensureNotBusy)
, removeResource(resources.lib).then(installResource)
])
}