Skip to content

Commit

Permalink
fix: use execFile instead of exec to avoid whitespace in path issues. (
Browse files Browse the repository at this point in the history
…#11)

chore: bump version

chore: fix vesion
  • Loading branch information
howech authored Oct 29, 2024
1 parent 7d8f24e commit 1091d2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { app, BrowserWindow, Tray, Menu } = require("electron");
const path = require("path");
const WebSocket = require("ws");
const { exec, spawn, execSync } = require("child_process");
const { execFile, spawn } = require("child_process");
const fs = require("fs").promises;
const kill = require("kill-port");
const { z } = require("zod");
Expand Down Expand Up @@ -269,8 +269,9 @@ async function getGpgKeys() {
return reject(new Error(errorMsg));
}

exec(
`"${GPG_PATH}" --list-keys --with-colons`,
execFile(
GPG_PATH,
["--list-keys", "--with-colons"],
async (error, stdout, stderr) => {
if (error) {
console.error("Error listing GPG keys:", stderr);
Expand Down
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.2",
"version": "0.0.3",
"description": "A very basic bridge to gpg over websockets",
"license": "MIT",
"main": "main.js",
Expand Down

0 comments on commit 1091d2f

Please sign in to comment.