Add an alternate install location for binary resources. Fixes devices where /data/local/tmp is mounted as noexec, like ZUK Z1. Closes #436.

This commit is contained in:
Simo Kinnunen
2017-02-10 04:45:14 +09:00
parent dc5ed0193f
commit 884c51b9b4
4 changed files with 145 additions and 38 deletions

View File

@@ -0,0 +1,21 @@
var util = require('util')
function Resource(options) {
this.src = options.src
this.dest = options.dest.shift()
this.comm = options.comm
this.mode = options.mode
this.fallback = options.dest
}
Resource.prototype.shift = function() {
if (this.fallback.length === 0) {
throw new Error(util.format(
'Out of fallback locations for "%s"'
, this.src
))
}
this.dest = this.fallback.shift()
}
module.exports = Resource