mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Catch file-not-found on startup when non-existant flow file specified
This commit is contained in:
parent
8c561e92c8
commit
8bb861124d
@ -137,17 +137,21 @@ function init(_settings, _runtime) {
|
||||
saveSettings = true;
|
||||
} else {
|
||||
// if it resolves to a dir - use it
|
||||
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
|
||||
if (stat && stat.isDirectory()) {
|
||||
activeProject = settings.flowFile;
|
||||
globalSettings.projects.activeProject = activeProject;
|
||||
// Now check for a credentialSecret
|
||||
if (settings.credentialSecret !== undefined) {
|
||||
globalSettings.projects.projects[settings.flowFile] = {
|
||||
credentialSecret: settings.credentialSecret
|
||||
try {
|
||||
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
|
||||
if (stat && stat.isDirectory()) {
|
||||
activeProject = settings.flowFile;
|
||||
globalSettings.projects.activeProject = activeProject;
|
||||
// Now check for a credentialSecret
|
||||
if (settings.credentialSecret !== undefined) {
|
||||
globalSettings.projects.projects[settings.flowFile] = {
|
||||
credentialSecret: settings.credentialSecret
|
||||
}
|
||||
saveSettings = true;
|
||||
}
|
||||
saveSettings = true;
|
||||
}
|
||||
} catch(err) {
|
||||
// Doesn't exist, handle as a flow file to be created
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user