@scopeide/cli 0.0.0-stage → 0.1.1
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/scope.js +15 -0
- package/dist/index.js +5557 -0
- package/package.json +51 -4
- package/README.md +0 -3
package/bin/scope.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs the built CLI if present, otherwise falls back to the TS source via tsx (workspace dev).
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
|
|
8
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const dist = path.join(here, "../dist/index.js");
|
|
10
|
+
if (existsSync(dist)) {
|
|
11
|
+
await import(pathToFileURL(dist).href);
|
|
12
|
+
} else {
|
|
13
|
+
const r = spawnSync("pnpm", ["exec", "tsx", path.join(here, "../src/index.ts"), ...process.argv.slice(2)], { stdio: "inherit", cwd: process.cwd() });
|
|
14
|
+
process.exit(r.status ?? 1);
|
|
15
|
+
}
|