cleanup git clone error

fixes #48486
This commit is contained in:
Joao Moreno
2018-04-25 19:31:05 +02:00
parent 6dfd02e089
commit 5ded9d963a

View File

@@ -392,7 +392,18 @@ export class Git {
const folderPath = path.join(parentPath, folderName);
await mkdirp(parentPath);
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
try {
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
} catch (err) {
if (err.stderr) {
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
err.stderr = err.stderr.replace(/^ERROR:\s+/, '').trim();
}
throw err;
}
return folderPath;
}