diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 063366f..847bf3a 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -313,13 +313,13 @@ export class LocalGitProvider implements GitProvider, Disposable { }, 1000); if (cc != null) { - cc.exitDetails = ` ${GlyphChars.Dot} Git found (${getDurationMilliseconds(start)} ms): ${ - location.version - } @ ${location.path === 'git' ? 'PATH' : location.path}`; + cc.exitDetails = ` ${GlyphChars.Dot} Git (${location.version}) found in ${ + location.path === 'git' ? 'PATH' : location.path + }`; } else { Logger.log( cc, - `Git found: ${location.version} @ ${location.path === 'git' ? 'PATH' : location.path} ${ + `Git (${location.version}) found in ${location.path === 'git' ? 'PATH' : location.path} ${ GlyphChars.Dot } ${getDurationMilliseconds(start)} ms`, ); diff --git a/src/env/node/git/locator.ts b/src/env/node/git/locator.ts index ca120b9..8965be7 100644 --- a/src/env/node/git/locator.ts +++ b/src/env/node/git/locator.ts @@ -26,10 +26,6 @@ export interface GitLocation { version: string; } -function parseVersion(raw: string): string { - return raw?.replace(/^git version /, ''); -} - async function findSpecificGit(path: string): Promise { const sw = new Stopwatch(`findSpecificGit(${path})`, { logLevel: LogLevel.Debug }); @@ -37,7 +33,7 @@ async function findSpecificGit(path: string): Promise { try { version = await run(path, ['--version'], 'utf8'); } catch (ex) { - sw.stop({ message: ` ${GlyphChars.Dot} Unable to find git` }); + sw.stop({ message: ` ${GlyphChars.Dot} Unable to find git: ${ex}` }); if (/bad config/i.test(ex.message)) throw new InvalidGitConfigError(ex); throw ex; @@ -51,7 +47,7 @@ async function findSpecificGit(path: string): Promise { try { version = await run(foundPath, ['--version'], 'utf8'); } catch (ex) { - sw.stop({ message: ` ${GlyphChars.Dot} Unable to find git` }); + sw.stop({ message: ` ${GlyphChars.Dot} Unable to find git: ${ex}` }); if (/bad config/i.test(ex.message)) throw new InvalidGitConfigError(ex); throw ex; @@ -60,11 +56,16 @@ async function findSpecificGit(path: string): Promise { path = foundPath; } - sw.stop({ message: ` ${GlyphChars.Dot} Found git @ ${path}` }); + const parsed = version + .trim() + .replace(/^git version /, '') + .trim(); + + sw.stop({ message: ` ${GlyphChars.Dot} Found ${parsed} in ${path}; ${version}` }); return { path: path, - version: parseVersion(version.trim()), + version: parsed, }; }