@dealdeploy/skl 0.1.3 → 0.1.5
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/index.ts +26 -10
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { join as _join, dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
const _pkgPath = _join(dirname(fileURLToPath(import.meta.url)), "package.json");
|
|
8
|
+
const _pkg = JSON.parse(readFileSync(_pkgPath, "utf8"));
|
|
9
|
+
|
|
10
|
+
// ── Flags ────────────────────────────────────────────────────────────
|
|
11
|
+
const arg = process.argv[2];
|
|
12
|
+
if (arg === "-v" || arg === "--version") {
|
|
13
|
+
console.log(`skl ${_pkg.version}`);
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
7
16
|
|
|
8
17
|
// ── Subcommand routing ───────────────────────────────────────────────
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
if (arg === "add") {
|
|
19
|
+
await import("./add.ts").catch((err) => {
|
|
20
|
+
console.error(`skl: ${err.message}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
12
23
|
process.exit(0);
|
|
13
24
|
}
|
|
14
25
|
|
|
15
|
-
import
|
|
26
|
+
// ── Dynamic import to ensure errors are visible ──────────────────────
|
|
27
|
+
const {
|
|
16
28
|
createCliRenderer,
|
|
17
29
|
BoxRenderable,
|
|
18
30
|
TextRenderable,
|
|
19
31
|
ScrollBoxRenderable,
|
|
20
32
|
TextAttributes,
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
} = await import("@opentui/core").catch((err) => {
|
|
34
|
+
console.error(`skl: failed to load TUI library: ${err.message}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|
|
37
|
+
type KeyEvent = import("@opentui/core").KeyEvent;
|
|
38
|
+
|
|
23
39
|
import {
|
|
24
40
|
readdirSync,
|
|
25
41
|
lstatSync,
|