From 9fabd9f486d8d59ebe37a5f83b0255d6081929e5 Mon Sep 17 00:00:00 2001 From: azlam Date: Wed, 4 Oct 2023 01:04:20 +1100 Subject: [PATCH] fix(git): ignore safeconfig error --- packages/core/src/git/Git.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/core/src/git/Git.ts b/packages/core/src/git/Git.ts index d6f7586f9..2ab1f737a 100644 --- a/packages/core/src/git/Git.ts +++ b/packages/core/src/git/Git.ts @@ -158,14 +158,13 @@ export default class Git { static async initiateRepo(logger?: Logger, projectDir?: string) { let git = new Git(projectDir, logger); - if (projectDir) await git.addSafeConfig(projectDir); - else { - try { + try { + if (projectDir) await git.addSafeConfig(projectDir); + else { await git.addSafeConfig(process.cwd()); - } catch (error) { - //Ignore if unable to set, its probably set already - SFPLogger.log(`Unable to add safe config, probably due to no change or something else,Please try manually`, LoggerLevel.TRACE, logger); } + } catch (error) { + SFPLogger.log(`Unable to add safe config`, LoggerLevel.TRACE, logger); } await git.getRemoteOriginUrl(); return git;