Skip to content

Commit

Permalink
fix: gpg errors
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 cfdef10 commit 92b02eb
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33118,19 +33118,17 @@ class GitClient {
importGPGKey(key) {
return __awaiter(this, void 0, void 0, function* () {
let keyId;
yield (0, exec_1.exec)("gpg", ["--import"], {
const { stdout } = yield (0, exec_1.getExecOutput)("gpg", ["--import"], {
input: Buffer.from(key, "utf-8"),
listeners: {
stdout: (data) => {
const match = data
.toString()
.match(/^gpg: key ([0-9A-F]+):/);
if (match) {
keyId = match[1];
}
},
},
});
console.log(stdout.split(/\n+/));
for (const data of stdout.split(/\n+/)) {
const match = data.match(/^gpg: key ([0-9A-F]+):/);
console.log(match === null ? null : [...match]);
if (match) {
keyId = match[1];
}
}
if (!keyId) {
throw new Error("Failed to import GPG key.");
}
Expand Down

0 comments on commit 92b02eb

Please sign in to comment.