mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Normalize ssh key paths for Windows file names
This commit is contained in:
parent
ce5242cfe8
commit
e8fd7484b6
@ -118,7 +118,7 @@ function generateSSHKey(username, options) {
|
|||||||
var password = options.password || "";
|
var password = options.password || "";
|
||||||
var size = options.size || 2048;
|
var size = options.size || 2048;
|
||||||
var sshKeyFileBasename = username + '_' + name;
|
var sshKeyFileBasename = username + '_' + name;
|
||||||
var privateKeyFilePath = fspath.join(sshkeyDir, sshKeyFileBasename);
|
var privateKeyFilePath = fs.normalize(fspath.join(sshkeyDir, sshKeyFileBasename));
|
||||||
return generateSSHKeyPair(name, privateKeyFilePath, comment, password, size)
|
return generateSSHKeyPair(name, privateKeyFilePath, comment, password, size)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -184,7 +184,7 @@ function generateSSHKeyPair(name, privateKeyPath, comment, password, size) {
|
|||||||
|
|
||||||
function getPrivateKeyPath(username, name) {
|
function getPrivateKeyPath(username, name) {
|
||||||
var sshKeyFileBasename = username + '_' + name;
|
var sshKeyFileBasename = username + '_' + name;
|
||||||
var privateKeyFilePath = fspath.join(sshkeyDir, sshKeyFileBasename);
|
var privateKeyFilePath = fspath.normalize(fspath.join(sshkeyDir, sshKeyFileBasename));
|
||||||
try {
|
try {
|
||||||
fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK);
|
fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK);
|
||||||
return privateKeyFilePath;
|
return privateKeyFilePath;
|
||||||
|
Loading…
Reference in New Issue
Block a user