Przeglądaj źródła

Fixes #1645 - removes regex

Possible catastrophic backtracking with large inputs (very unlikely in the wild)
main
Eric Amodio 2 lat temu
rodzic
commit
e417446f59
1 zmienionych plików z 2 dodań i 6 usunięć
  1. +2
    -6
      src/env/node/git/locator.ts

+ 2
- 6
src/env/node/git/locator.ts Wyświetl plik

@ -70,12 +70,8 @@ async function findSpecificGit(path: string): Promise {
async function findGitDarwin(): Promise<GitLocation> {
try {
let path = await run<string>('which', ['git'], 'utf8');
path = path.replace(/^\s+|\s+$/g, '');
if (path !== '/usr/bin/git') {
return findSpecificGit(path);
}
const path = (await run<string>('which', ['git'], 'utf8')).trim();
if (path !== '/usr/bin/git') return findSpecificGit(path);
try {
await run<string>('xcode-select', ['-p'], 'utf8');

Ładowanie…
Anuluj
Zapisz