mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Fix 'cannot read property R_OK of undefined' error in Node >=6 <6.3
Change-Type: patch
This commit is contained in:
parent
427664c729
commit
890a02e2c8
@ -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 {
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user