diff --git a/red/runtime/storage/localfilesystem/projects/ssh/index.js b/red/runtime/storage/localfilesystem/projects/ssh/index.js index 4188b07ce..dd65379cb 100644 --- a/red/runtime/storage/localfilesystem/projects/ssh/index.js +++ b/red/runtime/storage/localfilesystem/projects/ssh/index.js @@ -187,16 +187,18 @@ function getPrivateKeyPath(username, name) { var privateKeyFilePath = fspath.normalize(fspath.join(sshkeyDir, sshKeyFileBasename)); try { fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK); - return privateKeyFilePath; } catch(err) { privateKeyFilePath = fspath.join(userSSHKeyDir,name); try { fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK); - return privateKeyFilePath; } catch(err2) { return null; } } + if (fspath.sep === '\\') { + privateKeyFilePath = privateKeyFilePath.replace(/\\/g,'\\\\'); + } + return privateKeyFilePath; } module.exports = {