mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Avoid exception if git not installed
This commit is contained in:
parent
df4beef060
commit
d21568497b
@ -37,17 +37,19 @@ function runGitCommand(args,cwd,env) {
|
|||||||
child.stdout.on('data', function(data) {
|
child.stdout.on('data', function(data) {
|
||||||
stdout += data;
|
stdout += data;
|
||||||
});
|
});
|
||||||
|
|
||||||
child.stderr.on('data', function(data) {
|
child.stderr.on('data', function(data) {
|
||||||
stderr += data;
|
stderr += data;
|
||||||
});
|
});
|
||||||
|
child.on('error', function(err) {
|
||||||
|
stderr = err.toString();
|
||||||
|
})
|
||||||
child.on('close', function(code) {
|
child.on('close', function(code) {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
var err = new Error(stderr);
|
var err = new Error(stderr);
|
||||||
err.stdout = stdout;
|
err.stdout = stdout;
|
||||||
err.stderr = stderr;
|
err.stderr = stderr;
|
||||||
if (/fatal: could not read Username/.test(stderr)) {
|
if (/fatal: could not read/.test(stderr)) {
|
||||||
|
// Username/Password
|
||||||
err.code = "git_auth_failed";
|
err.code = "git_auth_failed";
|
||||||
} else if(/HTTP Basic: Access denied/.test(stderr)) {
|
} else if(/HTTP Basic: Access denied/.test(stderr)) {
|
||||||
err.code = "git_auth_failed";
|
err.code = "git_auth_failed";
|
||||||
|
Loading…
Reference in New Issue
Block a user