@exreve/exk 1.0.1 → 1.0.2
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/exk +9 -5
- package/package.json +1 -1
package/bin/exk
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
// exk CLI - entry point for npm global install
|
|
3
3
|
// Runs the TypeScript CLI via tsx
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { resolve, dirname } from 'path'
|
|
6
|
+
import { spawn } from 'child_process'
|
|
7
|
+
import fs from 'fs'
|
|
8
|
+
import { fileURLToPath } from 'url'
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = dirname(__filename)
|
|
12
|
+
|
|
13
|
+
const cliDir = __dirname
|
|
10
14
|
const pkgDir = resolve(cliDir, '..')
|
|
11
15
|
const entryPoint = resolve(pkgDir, 'index.ts')
|
|
12
16
|
|
|
@@ -36,7 +40,7 @@ const child = spawn(tsxBin, [entryPoint, ...args], {
|
|
|
36
40
|
})
|
|
37
41
|
|
|
38
42
|
child.on('exit', (code) => {
|
|
39
|
-
process.exit(code
|
|
43
|
+
process.exit(code ?? 0)
|
|
40
44
|
})
|
|
41
45
|
|
|
42
46
|
child.on('error', (err) => {
|