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

Ensure default settings copied to command-line specified userDir

Fixes #908
This commit is contained in:
Nick O'Leary 2016-06-17 21:15:40 +01:00
parent 7fc056c8e3
commit 08f2741871

2
red.js
View File

@ -81,7 +81,7 @@ if (parsedArgs.settings) {
// NODE_RED_HOME contains user data - use its settings.js // NODE_RED_HOME contains user data - use its settings.js
settingsFile = path.join(process.env.NODE_RED_HOME,"settings.js"); settingsFile = path.join(process.env.NODE_RED_HOME,"settings.js");
} else { } else {
var userDir = path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red"); var userDir = path.join(parsedArgs.userDir || process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red");
var userSettingsFile = path.join(userDir,"settings.js"); var userSettingsFile = path.join(userDir,"settings.js");
if (fs.existsSync(userSettingsFile)) { if (fs.existsSync(userSettingsFile)) {
// $HOME/.node-red/settings.js exists // $HOME/.node-red/settings.js exists