@dealdeploy/skl 0.1.5 → 0.1.6
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 -31
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,41 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
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
|
-
}
|
|
16
|
-
|
|
17
|
-
// ── Subcommand routing ───────────────────────────────────────────────
|
|
18
|
-
if (arg === "add") {
|
|
19
|
-
await import("./add.ts").catch((err) => {
|
|
20
|
-
console.error(`skl: ${err.message}`);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
});
|
|
23
|
-
process.exit(0);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// ── Dynamic import to ensure errors are visible ──────────────────────
|
|
27
|
-
const {
|
|
3
|
+
import {
|
|
28
4
|
createCliRenderer,
|
|
29
5
|
BoxRenderable,
|
|
30
6
|
TextRenderable,
|
|
31
7
|
ScrollBoxRenderable,
|
|
32
8
|
TextAttributes,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
process.exit(1);
|
|
36
|
-
});
|
|
37
|
-
type KeyEvent = import("@opentui/core").KeyEvent;
|
|
38
|
-
|
|
9
|
+
type KeyEvent,
|
|
10
|
+
} from "@opentui/core";
|
|
39
11
|
import {
|
|
40
12
|
readdirSync,
|
|
41
13
|
lstatSync,
|
|
@@ -49,6 +21,23 @@ import {
|
|
|
49
21
|
import { join, resolve } from "path";
|
|
50
22
|
import { homedir } from "os";
|
|
51
23
|
|
|
24
|
+
const VERSION = "0.1.5";
|
|
25
|
+
|
|
26
|
+
// ── Flags ────────────────────────────────────────────────────────────
|
|
27
|
+
const arg = process.argv[2];
|
|
28
|
+
if (arg === "-v" || arg === "--version") {
|
|
29
|
+
console.log(`skl ${VERSION}`);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ── Subcommand routing ───────────────────────────────────────────────
|
|
34
|
+
if (arg === "add") {
|
|
35
|
+
await import("./add.ts");
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
|
|
52
41
|
// ── Constants & helpers ─────────────────────────────────────────────
|
|
53
42
|
|
|
54
43
|
const LIBRARY = join(homedir(), "dotfiles/skills");
|
|
@@ -649,3 +638,9 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
|
|
|
649
638
|
if (ci !== null) updateRow(ci);
|
|
650
639
|
ensureVisible();
|
|
651
640
|
});
|
|
641
|
+
|
|
642
|
+
} catch (err: any) {
|
|
643
|
+
console.error(`skl: fatal: ${err?.message ?? err}`);
|
|
644
|
+
if (err?.stack) console.error(err.stack);
|
|
645
|
+
process.exit(1);
|
|
646
|
+
}
|