engine7 7.0.9 → 7.1.0
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/cli.mjs +13 -5
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -496,11 +496,19 @@ engine7 start \u2014 \u542F\u52A8 Engine
|
|
|
496
496
|
if (fs.existsSync(localPath)) {
|
|
497
497
|
enginePath = localPath;
|
|
498
498
|
} else {
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
499
|
+
const cliPath = path.resolve(process.argv[1]);
|
|
500
|
+
const distDir = path.dirname(cliPath);
|
|
501
|
+
const candidate = path.join(distDir, "main.mjs");
|
|
502
|
+
if (fs.existsSync(candidate)) {
|
|
503
|
+
enginePath = candidate;
|
|
504
|
+
} else {
|
|
505
|
+
try {
|
|
506
|
+
const globalRoot = execSync("npm root -g", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
507
|
+
enginePath = path.join(globalRoot, "engine7", "dist", "main.mjs");
|
|
508
|
+
} catch {
|
|
509
|
+
console.error("\u274C \u627E\u4E0D\u5230 engine7 main.mjs");
|
|
510
|
+
process.exit(1);
|
|
511
|
+
}
|
|
504
512
|
}
|
|
505
513
|
}
|
|
506
514
|
console.log(`\u{1F680} engine7 start`);
|