Przeglądaj źródła

Saves the found git path to avoid constant searchs

main
Eric Amodio 7 lat temu
rodzic
commit
14b9d93807
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      src/git/gitLocator.ts

+ 6
- 1
src/git/gitLocator.ts Wyświetl plik

@ -1,5 +1,5 @@
'use strict';
import { spawnPromise } from 'spawn-rx';
import { findActualExecutable, spawnPromise } from 'spawn-rx';
import * as path from 'path';
export interface IGit {
@ -13,6 +13,11 @@ function parseVersion(raw: string): string {
async function findSpecificGit(path: string): Promise<IGit> {
const version = await spawnPromise(path, ['--version']);
// If needed, let's update our path to avoid the search on every command
if (!path || path === 'git') {
path = findActualExecutable(path, ['--version']).cmd;
}
return {
path,
version: parseVersion(version.trim())

Ładowanie…
Anuluj
Zapisz