mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Catch file-not-found on startup when non-existant flow file specified
This commit is contained in:
parent
8c561e92c8
commit
8bb861124d
@ -137,6 +137,7 @@ function init(_settings, _runtime) {
|
|||||||
saveSettings = true;
|
saveSettings = true;
|
||||||
} else {
|
} else {
|
||||||
// if it resolves to a dir - use it
|
// if it resolves to a dir - use it
|
||||||
|
try {
|
||||||
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
|
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
|
||||||
if (stat && stat.isDirectory()) {
|
if (stat && stat.isDirectory()) {
|
||||||
activeProject = settings.flowFile;
|
activeProject = settings.flowFile;
|
||||||
@ -149,6 +150,9 @@ function init(_settings, _runtime) {
|
|||||||
saveSettings = true;
|
saveSettings = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch(err) {
|
||||||
|
// Doesn't exist, handle as a flow file to be created
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!activeProject) {
|
if (!activeProject) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user