@shareai-lab/kode 1.0.102 → 1.0.103

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.
Files changed (2) hide show
  1. package/cli.js +13 -7
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -35,14 +35,20 @@ function hasBun() {
35
35
  }
36
36
 
37
37
  function runWithBun() {
38
- const bunCmd = process.platform === 'win32' ? 'bun.cmd' : 'bun'
39
- const child = spawn(bunCmd, ['run', cliPath, ...args], {
40
- stdio: 'inherit',
41
- env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
42
- })
43
- child.on('error', () => runWithTsxImport())
38
+ const bunCmd = 'bun'
39
+ let child
40
+ try {
41
+ child = spawn(bunCmd, ['run', cliPath, ...args], {
42
+ stdio: 'inherit',
43
+ shell: process.platform === 'win32',
44
+ env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
45
+ })
46
+ } catch {
47
+ return process.platform === 'win32' ? runWindowsNoBun() : runPosixNoBun()
48
+ }
49
+ child.on('error', () => (process.platform === 'win32' ? runWindowsNoBun() : runPosixNoBun()))
44
50
  child.on('exit', code => {
45
- if (code && code !== 0) return runWithTsxImport()
51
+ if (code && code !== 0) return process.platform === 'win32' ? runWindowsNoBun() : runPosixNoBun()
46
52
  process.exit(code || 0)
47
53
  })
48
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shareai-lab/kode",
3
- "version": "1.0.102",
3
+ "version": "1.0.103",
4
4
  "bin": {
5
5
  "kode": "cli.js",
6
6
  "kwa": "cli.js",