Fix 'cannot read property R_OK of undefined' error in Node >=6 <6.3

Change-Type: patch
This commit is contained in:
Tim Perry 2017-11-11 12:29:49 +01:00
parent 427664c729
commit 890a02e2c8
2 changed files with 2 additions and 2 deletions

View File

@ -329,7 +329,7 @@ ensureDockerSeemsAccessible = function(options) {
var fs;
fs = require('mz/fs');
if (options.socketPath != null) {
return fs.access(options.socketPath, fs.constants.R_OK | fs.constants.W_OK)["return"](true)["catch"](function(err) {
return fs.access(options.socketPath, (fs.constants || fs).R_OK | (fs.constants || fs).W_OK)["return"](true)["catch"](function(err) {
throw new Error("Docker seems to be unavailable (using socket " + options.socketPath + "). Is it installed, and do you have permission to talk to it?");
});
} else {

View File

@ -341,7 +341,7 @@ ensureDockerSeemsAccessible = (options) ->
if options.socketPath?
# If we're trying to use a socket, check it exists and we have access to it
fs.access(options.socketPath, fs.constants.R_OK | fs.constants.W_OK)
fs.access(options.socketPath, (fs.constants || fs).R_OK | (fs.constants || fs).W_OK)
.return(true)
.catch (err) ->
throw new Error(