From e2a0447def606d4278962b940096224369dba5da Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Wed, 6 Sep 2017 16:31:36 +0900 Subject: [PATCH] Fix checkExecutable() not working correctly on Windows. --- CHANGELOG.md | 4 ++++ lib/units/device/resources/minicap.js | 3 ++- lib/units/device/resources/minirev.js | 3 ++- lib/units/device/resources/minitouch.js | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abbcc71c..ec636846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - The network column in the device list is now based on a value that gets updated in real time. The format of the column has changed slightly due to this change. +### Fixes + +- Fixed an issue on Windows where our device binaries may have failed to install due to an `Out of fallback locations` error caused by a faulty mode check. Thanks @iqianxing! + ## 3.1.0 (2017-08-31) ### Enhancements diff --git a/lib/units/device/resources/minicap.js b/lib/units/device/resources/minicap.js index b3d9dff3..3c6130c2 100644 --- a/lib/units/device/resources/minicap.js +++ b/lib/units/device/resources/minicap.js @@ -94,7 +94,8 @@ module.exports = syrup.serial() return adb.stat(options.serial, res.dest) .timeout(5000) .then(function(stats) { - return (stats.mode & fs.constants.S_IXUSR) === fs.constants.S_IXUSR + // Can't use fs.constants.S_IXUSR due to differences on Windows. + return (stats.mode & 0x40) === 0x40 }) } diff --git a/lib/units/device/resources/minirev.js b/lib/units/device/resources/minirev.js index 80b74a35..37b28401 100644 --- a/lib/units/device/resources/minirev.js +++ b/lib/units/device/resources/minirev.js @@ -63,7 +63,8 @@ module.exports = syrup.serial() return adb.stat(options.serial, res.dest) .timeout(5000) .then(function(stats) { - return (stats.mode & fs.constants.S_IXUSR) === fs.constants.S_IXUSR + // Can't use fs.constants.S_IXUSR due to differences on Windows. + return (stats.mode & 0x40) === 0x40 }) } diff --git a/lib/units/device/resources/minitouch.js b/lib/units/device/resources/minitouch.js index 5c59138b..ba1327fc 100644 --- a/lib/units/device/resources/minitouch.js +++ b/lib/units/device/resources/minitouch.js @@ -62,7 +62,8 @@ module.exports = syrup.serial() return adb.stat(options.serial, res.dest) .timeout(5000) .then(function(stats) { - return (stats.mode & fs.constants.S_IXUSR) === fs.constants.S_IXUSR + // Can't use fs.constants.S_IXUSR due to differences on Windows. + return (stats.mode & 0x40) === 0x40 }) }