import { SimpleGit } from "simple-git/promise" ; export default class GitIdentity { constructor ( private git ) { } async setUsernameAndEmail ( ) { await this . setUsername ( ) ; await this . setEmail ( ) ; } private async setUsername ( ) { let username ; if ( process . env . SFPOWERSCRIPTS_GIT_USERNAME ) { username = process . env . SFPOWERSCRIPTS_GIT_USERNAME ; } else { username = "sfpowerscripts" ; } await this . git . addConfig ( "user.name" , username ) ; } private async setEmail ( ) { let email ; if ( process . env . SFPOWERSCRIPTS_GIT_EMAIL ) { email = process . env . SFPOWERSCRIPTS_GIT_EMAIL ; } else { email = "sfpowerscripts@dxatscale.io" ; } await this . git . addConfig ( "user.email" , email ) ; } }