From 34180a6925528f1ae9cef24573b4dc683fe98e92 Mon Sep 17 00:00:00 2001 From: Chris Howe Date: Tue, 29 Oct 2024 15:29:41 -0500 Subject: [PATCH] fix: left a ref to exec in the code. (#13) --- main.js | 10 +++++++--- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 665490e..eb5034f 100644 --- a/main.js +++ b/main.js @@ -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); @@ -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 { diff --git a/package-lock.json b/package-lock.json index 7d0fd7b..6729ea6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gpg-bridge", - "version": "0.0.3", + "version": "0.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gpg-bridge", - "version": "0.0.3", + "version": "0.0.5", "license": "MIT", "dependencies": { "electron-squirrel-startup": "^1.0.0", diff --git a/package.json b/package.json index b410688..ca62b90 100644 --- a/package.json +++ b/package.json @@ -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",