mirror of
https://github.com/zadam/trilium.git
synced 2026-01-16 12:22:13 +01:00
- Implement --config (-c) flag to allow custom configuration file paths. - Add --help (-h) flag to display tool usage and available options. - Add --version (-v) flag to display the current Trilium version. - Update electron-start.mts to correctly pass command-line arguments to Electron. - Synchronize edit-docs version with the root package.json via update-version.ts. - Resolve config paths relative to the configuration file's directory. This makes edit-docs more robust and easier to use from external projects and immutable environments like Nix.
19 lines
650 B
TypeScript
19 lines
650 B
TypeScript
import { execSync } from "child_process";
|
|
import { getElectronPath, isNixOS } from "./utils.mjs";
|
|
|
|
const LD_LIBRARY_PATH = isNixOS() && execSync("nix eval --raw nixpkgs#gcc.cc.lib").toString("utf-8") + "/lib";
|
|
|
|
const args = process.argv.slice(2);
|
|
execSync(`${getElectronPath()} ${args.join(" ")} --no-sandbox`, {
|
|
stdio: "inherit",
|
|
env: {
|
|
...process.env,
|
|
NODE_OPTIONS: "--import tsx",
|
|
NODE_ENV: "development",
|
|
TRILIUM_ENV: "dev",
|
|
TRILIUM_RESOURCE_DIR: "../server/src",
|
|
BETTERSQLITE3_NATIVE_PATH: "node_modules/better-sqlite3/build/Release/better_sqlite3.node",
|
|
LD_LIBRARY_PATH
|
|
}
|
|
});
|