Add --config, --help, and --version flags to edit-docs

- 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.
This commit is contained in:
Wael Nasreddine
2026-01-10 12:09:18 -08:00
parent 015e41e792
commit fb4d63b049
4 changed files with 67 additions and 9 deletions

View File

@@ -3,7 +3,8 @@ import { getElectronPath, isNixOS } from "./utils.mjs";
const LD_LIBRARY_PATH = isNixOS() && execSync("nix eval --raw nixpkgs#gcc.cc.lib").toString("utf-8") + "/lib";
execSync(`${getElectronPath()} ${process.argv[2]} --no-sandbox`, {
const args = process.argv.slice(2);
execSync(`${getElectronPath()} ${args.join(" ")} --no-sandbox`, {
stdio: "inherit",
env: {
...process.env,

View File

@@ -26,7 +26,7 @@ function getVersion(packageJsonPath: string) {
function main() {
const version = getVersion(join(__dirname, "..", "package.json"));
for (const appName of ["server", "client", "desktop"]) {
for (const appName of ["server", "client", "desktop", "edit-docs"]) {
patchPackageJson(join(__dirname, "..", "apps", appName, "package.json"), version);
}