1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure userDir is an absolute path when used with sshkeygen

This commit is contained in:
Nick O'Leary 2018-02-26 23:45:21 +00:00
parent af947879d8
commit ce5242cfe8
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -29,7 +29,7 @@ function init(_settings, _runtime) {
settings = _settings; settings = _settings;
runtime = _runtime; runtime = _runtime;
log = runtime.log; log = runtime.log;
sshkeyDir = fspath.join(settings.userDir, "projects", ".sshkeys"); sshkeyDir = fspath.resolve(fspath.join(settings.userDir, "projects", ".sshkeys"));
userSSHKeyDir = fspath.join(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH, ".ssh"); userSSHKeyDir = fspath.join(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH, ".ssh");
// console.log('sshkeys.init()'); // console.log('sshkeys.init()');
return fs.ensureDir(sshkeyDir); return fs.ensureDir(sshkeyDir);