import simplegit , { SimpleGit } from "simple-git" ; export default class Git { private _git : SimpleGit ; constructor ( projectDir ? ) { if ( projectDir ) this . _git = simplegit ( projectDir ) ; else this . _git = simplegit ( ) ; } async show ( options ) { return this . _git . show ( options ) ; } async tag ( options ) { let tagResult = await this . _git . tag ( options ) ; let temp = tagResult . split ( "\n" ) ; temp . pop ( ) ; return temp ; } async diff ( options ) { let diffResult = await this . _git . diff ( options ) ; let temp = diffResult . split ( "\n" ) ; temp . pop ( ) ; return temp ; } async log ( options ) { let gitLogResult = await this . _git . log ( options ) ; return gitLogResult [ "all" ] [ 0 ] [ "hash" ] . split ( "\n" ) ; } }