import { ext } from '../extensionVariables' ; import { cpUtils } from './cpUtils' ; export namespace gitUtils { const gitCommand = 'git' ; export async function isGitInstalled ( workingDirectory ) { try { await cpUtils . executeCommand ( undefined , workingDirectory , gitCommand , '--version' ) ; return true ; } catch ( error ) { return false ; } } export async function gitInit ( workingDirectory ) { await cpUtils . executeCommand ( ext . outputChannel , workingDirectory , gitCommand , 'init' ) ; } export async function isInsideRepo ( workingDirectory ) { try { await cpUtils . executeCommand ( undefined , workingDirectory , gitCommand , 'rev-parse' , '--git-dir' ) ; return true ; } catch ( error ) { return false ; } } }