Update git.ts

This commit is contained in:
James Ives 2022-04-27 08:41:37 -04:00
parent c46739c7bd
commit 81db737cc8

View File

@ -21,7 +21,7 @@ export async function init(action: ActionInterface): Promise<void | Error> {
info(`Deploying using ${action.tokenType}… 🔑`) info(`Deploying using ${action.tokenType}… 🔑`)
info('Configuring git…') info('Configuring git…')
async function configureGit(throwOnError: boolean) { async function configure(throwOnError: boolean) {
try { try {
await execute( await execute(
`git config --global --add safe.directory "${action.workspace}"`, `git config --global --add safe.directory "${action.workspace}"`,
@ -47,6 +47,9 @@ export async function init(action: ActionInterface): Promise<void | Error> {
action.silent action.silent
) )
} catch { } catch {
info(
'There was a problemissue initilizing git, attempting to resolve …'
)
if (throwOnError) { if (throwOnError) {
throw new Error() throw new Error()
} }
@ -54,7 +57,7 @@ export async function init(action: ActionInterface): Promise<void | Error> {
} }
try { try {
await configureGit(false) await configure(false)
} catch { } catch {
// Attempt to re-run if initial configuration failed using git init. // Attempt to re-run if initial configuration failed using git init.
await execute(`git init`, action.workspace, action.silent) await execute(`git init`, action.workspace, action.silent)
@ -65,7 +68,7 @@ export async function init(action: ActionInterface): Promise<void | Error> {
action.silent action.silent
) )
await configureGit(true) await configure(true)
} }
try { try {