Catch file-not-found on startup when non-existant flow file specified

This commit is contained in:
Nick O'Leary 2018-12-13 10:59:03 +00:00
parent 8c561e92c8
commit 8bb861124d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 13 additions and 9 deletions

View File

@ -137,6 +137,7 @@ function init(_settings, _runtime) {
saveSettings = true;
} else {
// if it resolves to a dir - use it
try {
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
if (stat && stat.isDirectory()) {
activeProject = settings.flowFile;
@ -149,6 +150,9 @@ function init(_settings, _runtime) {
saveSettings = true;
}
}
} catch(err) {
// Doesn't exist, handle as a flow file to be created
}
}
}
if (!activeProject) {