bingocode 1.1.142 → 1.1.143

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/bingo-win.cjs CHANGED
@@ -64,7 +64,7 @@ function resolveBunExe() {
64
64
  }
65
65
  // npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
66
66
  try {
67
- const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
67
+ const npmPrefix = spawnSync('npm.cmd', ['prefix', '-g'], { encoding: 'utf-8' });
68
68
  if (npmPrefix.status === 0) {
69
69
  const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
70
70
  if (fs.existsSync(npmBun)) return npmBun;
@@ -75,7 +75,7 @@ function resolveBunExe() {
75
75
  if (fs.existsSync(homeBun)) return homeBun;
76
76
  // where bun.exe(PATH 兜底搜索)
77
77
  try {
78
- const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
78
+ const where = spawnSync('where', ['bun.exe'], { encoding: 'utf-8' });
79
79
  if (where.status === 0) {
80
80
  const found = where.stdout.trim().split(/\r?\n/)[0];
81
81
  if (found && fs.existsSync(found)) return found;
@@ -95,9 +95,9 @@ function installBun() {
95
95
 
96
96
  try {
97
97
  const npmResult = spawnSync(
98
- 'npm',
98
+ 'npm.cmd',
99
99
  ['install', '-g', 'bun', '--loglevel', 'error'],
100
- { stdio: 'inherit', shell: true }
100
+ { stdio: 'inherit' }
101
101
  );
102
102
  if (npmResult.status !== 0) {
103
103
  throw new Error(`npm install -g bun 失败,exit code ${npmResult.status}`);
@@ -41,7 +41,7 @@ function resolveBunExe() {
41
41
  }
42
42
  // npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
43
43
  try {
44
- const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
44
+ const npmPrefix = spawnSync('npm.cmd', ['prefix', '-g'], { encoding: 'utf-8' });
45
45
  if (npmPrefix.status === 0) {
46
46
  const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
47
47
  if (fs.existsSync(npmBun)) return npmBun;
@@ -52,7 +52,7 @@ function resolveBunExe() {
52
52
  if (fs.existsSync(homeBun)) return homeBun;
53
53
  // where bun.exe 兜底
54
54
  try {
55
- const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
55
+ const where = spawnSync('where', ['bun.exe'], { encoding: 'utf-8' });
56
56
  if (where.status === 0) {
57
57
  const found = where.stdout.trim().split(/\r?\n/)[0];
58
58
  if (found && fs.existsSync(found)) return found;
@@ -39,7 +39,7 @@ function resolveBunExe() {
39
39
  }
40
40
  // npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
41
41
  try {
42
- const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
42
+ const npmPrefix = spawnSync('npm.cmd', ['prefix', '-g'], { encoding: 'utf-8' });
43
43
  if (npmPrefix.status === 0) {
44
44
  const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
45
45
  if (fs.existsSync(npmBun)) return npmBun;
@@ -50,7 +50,7 @@ function resolveBunExe() {
50
50
  if (fs.existsSync(homeBun)) return homeBun;
51
51
  // where bun.exe 兜底
52
52
  try {
53
- const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
53
+ const where = spawnSync('where', ['bun.exe'], { encoding: 'utf-8' });
54
54
  if (where.status === 0) {
55
55
  const found = where.stdout.trim().split(/\r?\n/)[0];
56
56
  if (found && fs.existsSync(found)) return found;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.142",
3
+ "version": "1.1.143",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -50,7 +50,7 @@
50
50
  if (process.platform === 'win32') {
51
51
  // npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
52
52
  try {
53
- const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
53
+ const npmPrefix = spawnSync('npm.cmd', ['prefix', '-g'], { encoding: 'utf-8' });
54
54
  if (npmPrefix.status === 0) {
55
55
  const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
56
56
  if (fs.existsSync(npmBun)) return npmBun;
@@ -61,7 +61,7 @@
61
61
  if (fs.existsSync(homeBun)) return homeBun;
62
62
  // where bun.exe 兜底
63
63
  try {
64
- const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
64
+ const where = spawnSync('where', ['bun.exe'], { encoding: 'utf-8' });
65
65
  if (where.status === 0) {
66
66
  const found = where.stdout.trim().split(/\r?\n/)[0];
67
67
  if (found && fs.existsSync(found)) return found;