aegiscode 3.0.8 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +7 -7
- package/gui/run-gui.cjs +1 -35
- package/package.json +1 -1
package/gui/run-gui.cjs
CHANGED
|
@@ -2,43 +2,9 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const { spawn } = require("child_process");
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
|
|
7
|
-
// Resolve the external aegiscode-gui project — sibling directory by convention,
|
|
8
|
-
// fall back to ~/.local/share/aegiscode-gui for installed builds.
|
|
9
|
-
function findGuiDir() {
|
|
10
|
-
const candidates = [
|
|
11
|
-
path.join(__dirname, "..", "..", "aegiscode-gui"), // dev: sibling
|
|
12
|
-
path.join(__dirname, "..", "..", "..", "aegiscode-gui"), // dev: when installed as dep
|
|
13
|
-
path.join(require("os").homedir(), ".local", "share", "aegiscode-gui"),
|
|
14
|
-
"/opt/aegiscode-gui",
|
|
15
|
-
];
|
|
16
|
-
// Also check $HOME/aegiscode-gui (common dev setup) and AEGIS_CODE_GUI env var
|
|
17
|
-
const envDir = process.env.AEGIS_CODE_GUI_DIR || process.env.AEGIS_CODE_GUI;
|
|
18
|
-
if (envDir) candidates.unshift(envDir);
|
|
19
|
-
candidates.push(path.join(require("os").homedir(), "aegiscode-gui"));
|
|
20
|
-
|
|
21
|
-
for (const dir of candidates) {
|
|
22
|
-
const p = path.join(dir, "run-gui.cjs");
|
|
23
|
-
if (fs.existsSync(p)) return dir;
|
|
24
|
-
}
|
|
25
|
-
// Check if we're running inside the aegiscode-gui project itself
|
|
26
|
-
const self = path.resolve(__dirname);
|
|
27
|
-
if (fs.existsSync(path.join(self, "..", "main.js"))) return path.resolve(self, "..");
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const guiDir = findGuiDir();
|
|
32
|
-
if (!guiDir) {
|
|
33
|
-
console.error("aegiscode-gui not found. Clone it alongside aegiscode:\n git clone https://github.com/aegisinfo/aegiscode-gui.git");
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
5
|
|
|
6
|
+
const guiDir = path.resolve(__dirname);
|
|
37
7
|
const electron = path.join(guiDir, "node_modules", ".bin", "electron");
|
|
38
|
-
if (!fs.existsSync(electron)) {
|
|
39
|
-
console.error("Electron not found in aegiscode-gui. Run:\n cd " + guiDir + " && npm install");
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
8
|
|
|
43
9
|
spawn(electron, ["."], {
|
|
44
10
|
cwd: guiDir,
|
package/package.json
CHANGED