diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js index 0fbf89de4..6cc98049a 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js @@ -421,7 +421,7 @@ Project.prototype.update = function (user, data) { } return when.settle(promises).then(function(res) { var gitSettings = getUserGitSettings(user) || {}; - var workflowMode = (gitSettings.workflow||{}).mode || "manual"; + var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; if (workflowMode === 'auto') { return project.stageFile(modifiedFiles.map(f => project.paths[f])).then(() => { return project.commit(user,{message:"Update "+modifiedFiles.join(", ")}) diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js index 5e1d4f15b..2f2990e08 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js @@ -35,7 +35,7 @@ var projectsEnabled = false; var projectLogMessages = []; var projectsDir; -var activeProject +var activeProject; var globalGitUser = false; @@ -107,6 +107,10 @@ function init(_settings, _runtime) { } catch(err) { } } else { + // Ensure there's a default workflow mode set + settings.editorTheme.projects.workflow = { + mode: (settings.editorTheme.projects.workflow || {}).mode || "manual" + } globalGitUser = gitConfig.user; Projects.init(settings,runtime); sshTools.init(settings); @@ -576,7 +580,7 @@ function saveFlows(flows, user) { } return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => { var gitSettings = getUserGitSettings(user) || {}; - var workflowMode = (gitSettings.workflow||{}).mode || "manual"; + var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; if (activeProject && workflowMode === 'auto') { return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { return activeProject.commit(user,{message:"Update flow files"})