1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure runtime side picks up default project workflow mode

This commit is contained in:
Nick O'Leary 2020-11-18 12:23:27 +00:00
parent 81f200641b
commit 0f7d185a61
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 7 additions and 3 deletions

View File

@ -421,7 +421,7 @@ Project.prototype.update = function (user, data) {
} }
return when.settle(promises).then(function(res) { return when.settle(promises).then(function(res) {
var gitSettings = getUserGitSettings(user) || {}; var gitSettings = getUserGitSettings(user) || {};
var workflowMode = (gitSettings.workflow||{}).mode || "manual"; var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode;
if (workflowMode === 'auto') { if (workflowMode === 'auto') {
return project.stageFile(modifiedFiles.map(f => project.paths[f])).then(() => { return project.stageFile(modifiedFiles.map(f => project.paths[f])).then(() => {
return project.commit(user,{message:"Update "+modifiedFiles.join(", ")}) return project.commit(user,{message:"Update "+modifiedFiles.join(", ")})

View File

@ -35,7 +35,7 @@ var projectsEnabled = false;
var projectLogMessages = []; var projectLogMessages = [];
var projectsDir; var projectsDir;
var activeProject var activeProject;
var globalGitUser = false; var globalGitUser = false;
@ -107,6 +107,10 @@ function init(_settings, _runtime) {
} catch(err) { } catch(err) {
} }
} else { } else {
// Ensure there's a default workflow mode set
settings.editorTheme.projects.workflow = {
mode: (settings.editorTheme.projects.workflow || {}).mode || "manual"
}
globalGitUser = gitConfig.user; globalGitUser = gitConfig.user;
Projects.init(settings,runtime); Projects.init(settings,runtime);
sshTools.init(settings); sshTools.init(settings);
@ -576,7 +580,7 @@ function saveFlows(flows, user) {
} }
return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => { return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => {
var gitSettings = getUserGitSettings(user) || {}; var gitSettings = getUserGitSettings(user) || {};
var workflowMode = (gitSettings.workflow||{}).mode || "manual"; var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode;
if (activeProject && workflowMode === 'auto') { if (activeProject && workflowMode === 'auto') {
return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => {
return activeProject.commit(user,{message:"Update flow files"}) return activeProject.commit(user,{message:"Update flow files"})