This commit is contained in:
Joao Moreno
2017-09-28 10:05:20 +02:00
parent 9fe72c0a2e
commit ae7e9613ce

View File

@@ -143,16 +143,17 @@ function findGitWin32(): Promise<IGit> {
export function findGit(hint: string | undefined): Promise<IGit> {
var first = hint ? findSpecificGit(hint) : Promise.reject<IGit>(null);
return first.then(void 0, () => {
switch (process.platform) {
case 'darwin': return findGitDarwin();
case 'win32': return findGitWin32();
default: return findSpecificGit('git');
}
});
return first
.then(void 0, () => {
switch (process.platform) {
case 'darwin': return findGitDarwin();
case 'win32': return findGitWin32();
default: return findSpecificGit('git');
}
})
.then(null, () => Promise.reject(new Error('Git installation not found.')));
}
export interface IExecutionResult {
exitCode: number;
stdout: string;