Skip to content

Commit

Permalink
fix: git failure
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <rakinar2@onesoftnet.eu.org>
  • Loading branch information
virtual-designer committed Aug 28, 2024
1 parent eb0ec2f commit 8442162
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31829,11 +31829,14 @@ class GitClient {
setup(_a) {
return __awaiter(this, arguments, void 0, function* ({ name, email, gpgKey }) {
this.oldGitOptions.name =
(yield this.exec("config", "user.name")) || undefined;
(yield this.exec("config", "user.name").catch(() => "")) ||
undefined;
this.oldGitOptions.email =
(yield this.exec("config", "user.email")) || undefined;
(yield this.exec("config", "user.email").catch(() => "")) ||
undefined;
this.oldGitOptions.gpgKeyId =
(yield this.exec("config", "user.signingkey")) || undefined;
(yield this.exec("config", "user.signingkey").catch(() => "")) ||
undefined;
yield this.exec("config", "user.name", name);
yield this.exec("config", "user.email", email);
if (gpgKey) {
Expand Down
9 changes: 6 additions & 3 deletions src/GitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ class GitClient implements AsyncDisposable {

public async setup({ name, email, gpgKey }: SetupOptions) {
this.oldGitOptions.name =
(await this.exec("config", "user.name")) || undefined;
(await this.exec("config", "user.name").catch(() => "")) ||
undefined;
this.oldGitOptions.email =
(await this.exec("config", "user.email")) || undefined;
(await this.exec("config", "user.email").catch(() => "")) ||
undefined;
this.oldGitOptions.gpgKeyId =
(await this.exec("config", "user.signingkey")) || undefined;
(await this.exec("config", "user.signingkey").catch(() => "")) ||
undefined;

await this.exec("config", "user.name", name);
await this.exec("config", "user.email", email);
Expand Down

0 comments on commit 8442162

Please sign in to comment.