mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Check version of git client on startup
This commit is contained in:
parent
a52f195d41
commit
df4beef060
@ -148,7 +148,7 @@
|
||||
"disabled": "Projects disabled : editorTheme.projects.enabled=false",
|
||||
"disabledNoFlag": "Projects disabled : set editorTheme.projects.enabled=true to enable",
|
||||
"git-not-found": "Projects disabled : git command not found",
|
||||
"git-version-old": "Projects disabled : git __version__ too old"
|
||||
"git-version-old": "Projects disabled : git __version__ not supported. Requires 2.x"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -393,9 +393,10 @@ module.exports = {
|
||||
email: globalUserEmail
|
||||
}
|
||||
}
|
||||
log.trace("git init: "+JSON.stringify(result));
|
||||
resolve(result);
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
log.trace("git init: git not found");
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
|
@ -46,7 +46,6 @@ function init(_settings, _runtime) {
|
||||
|
||||
try {
|
||||
if (settings.editorTheme.projects.enabled === true) {
|
||||
projectLogMessages.push(log._("storage.localfilesystem.projects.disabled"))
|
||||
projectsEnabled = true;
|
||||
} else if (settings.editorTheme.projects.enabled === false) {
|
||||
projectLogMessages.push(log._("storage.localfilesystem.projects.disabled"))
|
||||
@ -92,8 +91,12 @@ function init(_settings, _runtime) {
|
||||
if (projectsEnabled) {
|
||||
return sshTools.init(settings,runtime).then(function() {
|
||||
gitTools.init(_settings, _runtime).then(function(gitConfig) {
|
||||
if (!gitConfig) {
|
||||
projectLogMessages.push(log._("storage.localfilesystem.projects.git-not-found"))
|
||||
if (!gitConfig || /^1\./.test(gitConfig.version)) {
|
||||
if (!gitConfig) {
|
||||
projectLogMessages.push(log._("storage.localfilesystem.projects.git-not-found"))
|
||||
} else {
|
||||
projectLogMessages.push(log._("storage.localfilesystem.projects.git-version-old",{version:gitConfig.version}))
|
||||
}
|
||||
projectsEnabled = false;
|
||||
try {
|
||||
// As projects have to be turned on, we know this property
|
||||
|
Loading…
Reference in New Issue
Block a user