Skip to content

Commit

Permalink
fix: left a ref to exec in the code. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
howech authored Oct 29, 2024
1 parent 7531fa4 commit 34180a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ async function getGpgKeys() {
const armoredKeys = await Promise.all(
keys.map((key) =>
execPromise(
`${GPG_PATH} --export --armor --export-options export-minimal ${key.fingerprint}!`
GPG_PATH,
[
"--export", "--armor", "--export-options",
"export-minimal", `${key.fingerprint}!`
]
).then(
({ stdout }) => {
console.log("Armored key:", stdout);
Expand Down Expand Up @@ -334,9 +338,9 @@ async function getGpgKeys() {
});
}

function execPromise(command) {
function execPromise(command, args) {
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
execFile(command, args, (error, stdout, stderr) => {
if (error) {
reject(error);
} else {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gpg-bridge",
"version": "0.0.4",
"version": "0.0.5",
"description": "A very basic bridge to gpg over websockets",
"license": "MIT",
"main": "main.js",
Expand Down

0 comments on commit 34180a6

Please sign in to comment.