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

Create default settings.js in the user-specified directory

Fixes #908
This commit is contained in:
Nick O'Leary 2016-06-20 14:41:47 +01:00
parent 939da4e551
commit b6fcaacb77
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
#### xxx: unreleased
Fixes
- Create default setting.js in user-specified directory. Fixes #908
#### 0.14.2: Maintenance Release
Fixes

2
red.js
View File

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