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

Allow a project to be specified on the command-line

Reuses the existing flowFile - if its value is found
to be the name of an existing project, that project
is set as the active one.

If it is not the name of an existing project, it is
ignored.
This commit is contained in:
Nick O'Leary 2018-01-08 16:10:54 +00:00
parent 1d7ae300e2
commit 1c2ea56f42
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -107,6 +107,13 @@ function init(_settings, _runtime) {
} else { } else {
activeProject = globalSettings.projects.activeProject; activeProject = globalSettings.projects.activeProject;
} }
if (settings.flowFile) {
if (globalSettings.projects.projects.hasOwnProperty(settings.flowFile)) {
activeProject = settings.flowFile;
globalSettings.projects.activeProject = settings.flowFile;
saveSettings = true;
}
}
if (!activeProject) { if (!activeProject) {
projectLogMessages.push(log._("storage.localfilesystem.no-active-project")) projectLogMessages.push(log._("storage.localfilesystem.no-active-project"))
} }