mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:23:28 +02:00
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:
21
lib/units/device/resources/util/resource.js
Normal file
21
lib/units/device/resources/util/resource.js
Normal 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
|
||||
Reference in New Issue
Block a user