mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
don't use shell for obsidian headless
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user