don't use shell for obsidian headless

This commit is contained in:
Nystik
2026-06-11 15:01:16 +02:00
parent ccf424af47
commit cb258e97bf

View File

@@ -3,8 +3,6 @@ const fs = require("fs");
const os = require("os"); const os = require("os");
const path = require("path"); const path = require("path");
const isWindows = process.platform === "win32";
// When set via configure(), HOME for the spawned ob points under the plugin's data dir so // When set via configure(), HOME for the spawned ob points under the plugin's data dir so
// ob's config dir (~/.config/obsidian-headless/) survives container recreates. // ob's config dir (~/.config/obsidian-headless/) survives container recreates.
let configuredDataDir = null; let configuredDataDir = null;
@@ -39,13 +37,11 @@ function checkInstalled() {
} }
function spawnOb(args, opts = {}) { function spawnOb(args, opts = {}) {
const home = configuredDataDir const home = configuredDataDir ? getObHome(configuredDataDir) : os.homedir();
? getObHome(configuredDataDir)
: os.homedir();
return spawn("ob", args, { return spawn("ob", args, {
env: { ...process.env, HOME: home }, env: { ...process.env, HOME: home },
shell: isWindows, shell: false,
windowsHide: true, windowsHide: true,
...opts, ...opts,
}); });