mirror of
https://github.com/openclaw/lobster.git
synced 2026-08-14 00:48:09 +00:00
fix(windows): improve CLI startup and build script compatibility (#36)
Merged via squash. Validated in a fresh checkout with: - pnpm build - pnpm test
This commit is contained in:
+4
-3
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { existsSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
@@ -10,9 +10,10 @@ const __dirname = dirname(__filename);
|
||||
async function load() {
|
||||
const distEntry = join(__dirname, "../dist/src/cli.js");
|
||||
if (existsSync(distEntry)) {
|
||||
return import(distEntry);
|
||||
return import(pathToFileURL(distEntry).href);
|
||||
}
|
||||
return import(join(__dirname, "../src/cli.js"));
|
||||
const srcEntry = join(__dirname, "../src/cli.js");
|
||||
return import(pathToFileURL(srcEntry).href);
|
||||
}
|
||||
|
||||
const mod = await load();
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@
|
||||
},
|
||||
"main": "./dist/src/sdk/index.js",
|
||||
"scripts": {
|
||||
"clean": "rm -rf dist",
|
||||
"build": "pnpm clean && tsc -p tsconfig.json",
|
||||
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
||||
"build": "pnpm clean && pnpm exec tsc -p tsconfig.json",
|
||||
"prepack": "pnpm build",
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||
"lint": "oxlint --tsconfig tsconfig.json src test",
|
||||
|
||||
Reference in New Issue
Block a user