mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 13:56:15 +02:00
fix(scripts): use flake when rebuilding Electron in postinstall script
This commit is contained in:
@@ -28,7 +28,7 @@ function resetPath() {
|
||||
|
||||
export function getElectronPath() {
|
||||
if (isNixOS()) {
|
||||
resetPath();
|
||||
resetPath();
|
||||
|
||||
try {
|
||||
const path = execSync("which electron").toString("utf-8").trimEnd();
|
||||
@@ -37,8 +37,16 @@ export function getElectronPath() {
|
||||
// Nothing to do, since we have a fallback below.
|
||||
}
|
||||
|
||||
console.log("Using default since no Electron is available in path.");
|
||||
return execSync("nix eval --raw nixpkgs#electron_37").toString("utf-8") + "/bin/electron";
|
||||
console.log("No Electron in PATH, using 'nix develop' to get it...");
|
||||
|
||||
try {
|
||||
const path = execSync("nix develop -c which electron", { stdio: ["pipe", "pipe", "pipe"] }).toString("utf-8").trimEnd();
|
||||
return path;
|
||||
} catch (e) {
|
||||
console.error("\nFailed to get Electron from 'nix develop'.");
|
||||
console.error("Please ensure you have a valid flake.nix with electron in devShells.default.");
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
return "electron";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user