Skip to content

Commit

Permalink
fix(git): add an exception catch to gith init
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Oct 3, 2023
1 parent 524c283 commit 4715ac3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/git/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ export default class Git {
static async initiateRepo(logger?: Logger, projectDir?: string) {
let git = new Git(projectDir, logger);
if (projectDir) await git.addSafeConfig(projectDir);
else await git.addSafeConfig(process.cwd());
else {
try {
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);
}
}
await git.getRemoteOriginUrl();
return git;
}
Expand Down

0 comments on commit 4715ac3

Please sign in to comment.