Skip to content

Commit

Permalink
fix(git): ignore safeconfig error
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Oct 3, 2023
1 parent c00c3ad commit 9fabd9f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/core/src/git/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9fabd9f

Please sign in to comment.