mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3540 from hardillb/no-home-dir
Don't start if user has no home directory
This commit is contained in:
commit
a2de514c05
4
packages/node_modules/node-red/red.js
vendored
4
packages/node_modules/node-red/red.js
vendored
@ -112,6 +112,10 @@ if (parsedArgs.settings) {
|
||||
// Consider compatibility for older versions
|
||||
settingsFile = path.join(process.env.HOMEPATH,".node-red","settings.js");
|
||||
} else {
|
||||
if (!parsedArgs.userDir && !(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH)) {
|
||||
console.log("Could not find user directory. Ensure $HOME is set for the current user, or use --userDir option")
|
||||
process.exit(1)
|
||||
}
|
||||
var userDir = parsedArgs.userDir || path.join(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH,".node-red");
|
||||
var userSettingsFile = path.join(userDir,"settings.js");
|
||||
if (fs.existsSync(userSettingsFile)) {
|
||||
|
Loading…
Reference in New Issue
Block a user