shin-engine 1.0.5 → 1.0.7
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/bin/ee.js +25 -6
- package/package.json +1 -1
package/bin/ee.js
CHANGED
|
@@ -7,6 +7,8 @@ const https = require("https");
|
|
|
7
7
|
const http = require("http");
|
|
8
8
|
const os = require("os");
|
|
9
9
|
|
|
10
|
+
const PKG = require(join(__dirname, "..", "package.json"));
|
|
11
|
+
const VERSION = PKG.version;
|
|
10
12
|
const EE_HOME = join(os.homedir(), ".ee");
|
|
11
13
|
const BRAIN_DIR = join(EE_HOME, "engineering-brain");
|
|
12
14
|
const JAR = join(EE_HOME, "ee.jar");
|
|
@@ -59,22 +61,33 @@ function isRunning() {
|
|
|
59
61
|
} catch { return false; }
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
function installJava() {
|
|
65
|
+
try {
|
|
66
|
+
execSync("winget install --id EclipseAdoptium.Temurin.21.JDK --accept-package-agreements --silent 2>&1", { encoding: "utf-8", timeout: 120000 });
|
|
67
|
+
ok("Java 21 installed via winget");
|
|
68
|
+
} catch {
|
|
69
|
+
log(" Auto-install failed. Install manually from: https://adoptium.net/");
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
62
74
|
async function ensureSetup() {
|
|
63
75
|
if (existsSync(JAR)) return true;
|
|
64
76
|
|
|
65
77
|
step("SHIN first-time setup");
|
|
66
78
|
|
|
67
|
-
// Check Java
|
|
79
|
+
// Check/Install Java
|
|
68
80
|
try {
|
|
69
81
|
const v = execSync("java -version 2>&1", { encoding: "utf-8" });
|
|
70
82
|
if (!v.match(/"(\d+)/) || parseInt(v.match(/"(\d+)/)[1]) < 21) {
|
|
71
|
-
log(" Java
|
|
72
|
-
|
|
83
|
+
log(" Java version too old. Installing Java 21...");
|
|
84
|
+
installJava();
|
|
85
|
+
} else {
|
|
86
|
+
ok("Java found");
|
|
73
87
|
}
|
|
74
|
-
ok("Java found");
|
|
75
88
|
} catch {
|
|
76
|
-
log(" Java
|
|
77
|
-
|
|
89
|
+
log(" Java not found. Installing Java 21...");
|
|
90
|
+
installJava();
|
|
78
91
|
}
|
|
79
92
|
|
|
80
93
|
// Download EE
|
|
@@ -123,6 +136,11 @@ async function ensureSetup() {
|
|
|
123
136
|
}
|
|
124
137
|
|
|
125
138
|
async function main() {
|
|
139
|
+
if (cmd === "--version" || cmd === "-v") {
|
|
140
|
+
log("shin-engine v" + VERSION);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
126
144
|
if (!cmd) {
|
|
127
145
|
log("Usage: shin <command>");
|
|
128
146
|
log("Run 'shin --help' for options");
|
|
@@ -189,6 +207,7 @@ async function main() {
|
|
|
189
207
|
log(" shin stop Stop the SHIN backend");
|
|
190
208
|
log(" shin status Check if SHIN is running");
|
|
191
209
|
log(" shin view Open the SHIN dashboard in browser");
|
|
210
|
+
log(" shin --version Show version");
|
|
192
211
|
return;
|
|
193
212
|
}
|
|
194
213
|
|