mirror of
https://github.com/zadam/trilium.git
synced 2025-10-08 06:28:53 +08:00
chore(dx/desktop): read electron version from package.json
This commit is contained in:
parent
e18a8556c1
commit
1258d0cf7d
1 changed files with 2 additions and 2 deletions
|
@ -3,6 +3,7 @@ import { cpSync, existsSync, mkdirSync, readFileSync, rmSync } from "fs";
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { rebuild } from "@electron/rebuild"
|
import { rebuild } from "@electron/rebuild"
|
||||||
import { isNixOS, resetPath } from "../../../scripts/utils.mjs";
|
import { isNixOS, resetPath } from "../../../scripts/utils.mjs";
|
||||||
|
import packageJson from "../package.json" with { type: "json" };
|
||||||
|
|
||||||
const desktopProjectRoot = join(import.meta.dirname, "..");
|
const desktopProjectRoot = join(import.meta.dirname, "..");
|
||||||
const workspaceRoot = join(desktopProjectRoot, "../..");
|
const workspaceRoot = join(desktopProjectRoot, "../..");
|
||||||
|
@ -36,8 +37,6 @@ function rebuildNativeDependencies() {
|
||||||
if (isNixOS()) {
|
if (isNixOS()) {
|
||||||
console.log("Patching ELF...");
|
console.log("Patching ELF...");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return execSync(`nix-shell -p auto-patchelf gcc.cc.lib --run "auto-patchelf --paths node_modules/better-sqlite3/build/Release/better_sqlite3.node --libs ${libStdPath}"`, {
|
return execSync(`nix-shell -p auto-patchelf gcc.cc.lib --run "auto-patchelf --paths node_modules/better-sqlite3/build/Release/better_sqlite3.node --libs ${libStdPath}"`, {
|
||||||
cwd: desktopProjectRoot,
|
cwd: desktopProjectRoot,
|
||||||
stdio: "inherit"
|
stdio: "inherit"
|
||||||
|
@ -58,6 +57,7 @@ function determineElectronVersion() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("Using Electron version from package.json");
|
console.log("Using Electron version from package.json");
|
||||||
|
return packageJson.devDependencies.electron;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue