fix flowfile name to flows.json in settings

and warn if not set (as if anyone reads warnings)
Move setting to top of settings.js as it will be edited more often.
Default behaviour will still work
(needs translations)
This commit is contained in:
Dave Conway-Jones
2021-04-23 14:09:06 +01:00
parent 719aea2a58
commit 5cc791690b
3 changed files with 13 additions and 8 deletions

View File

@@ -38,6 +38,8 @@ var activeProject;
var globalGitUser = false;
var usingHostName = false;
function init(_settings, _runtime) {
settings = _settings;
runtime = _runtime;
@@ -77,6 +79,7 @@ function init(_settings, _runtime) {
} else {
flowsFile = 'flows_'+require('os').hostname()+'.json';
flowsFullPath = fspath.join(settings.userDir,flowsFile);
usingHostName = true;
}
var ffExt = fspath.extname(flowsFullPath);
var ffBase = fspath.basename(flowsFullPath,ffExt);
@@ -526,7 +529,7 @@ async function getFlows() {
if (projectsEnabled) {
log.info(log._("storage.localfilesystem.projects.projects-directory", {projectsDirectory: projectsDir}));
}
if (activeProject) {
// At this point activeProject will be a string, so go load it and
// swap in an instance of Project
@@ -541,6 +544,7 @@ async function getFlows() {
} else {
projectLogMessages.forEach(log.warn);
}
if (usingHostName) { log.warn(log._("storage.localfilesystem.warn_name")) };
log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));
}
}