sakitamanler-ccl-launcher 1.0.2 → 1.0.4

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/ccl CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { spawn } = require('child_process');
3
+ const { spawn, execSync } = require('child_process');
4
4
  const process = require('process');
5
5
  const path = require('path');
6
6
 
@@ -16,11 +16,18 @@ function getTargetCommand() {
16
16
  return 'ccl-darwin-x64';
17
17
  case 'linux-x64':
18
18
  return 'ccl-linux-x64';
19
- case 'win32-x64':
19
+ case 'win32-x64': {
20
20
  // Windows 下直接使用 ccl.exe
21
- const pkgPath = path.join(__dirname, '..', 'node_modules', 'sakitamanler-ccl-win32');
22
- const exePath = path.join(pkgPath, 'ccl.exe');
23
- return exePath;
21
+ // 获取 npm 全局 node_modules 路径
22
+ try {
23
+ const npmRoot = execSync('npm root -g', { encoding: 'utf-8' }).trim();
24
+ const pkgPath = path.join(npmRoot, 'sakitamanler-ccl-win32');
25
+ const exePath = path.join(pkgPath, 'ccl.exe');
26
+ return exePath;
27
+ } catch (error) {
28
+ throw new Error('Failed to locate npm global directory. Please ensure npm is properly installed.');
29
+ }
30
+ }
24
31
  default:
25
32
  throw new Error(`Unsupported platform: ${platform}-${arch}`);
26
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakitamanler-ccl-launcher",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "sakitamanler Claude Code Launcher CLI 安装器",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -28,6 +28,6 @@
28
28
  "author": "sakitamanler",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "sakitamanler-ccl-win32": "^1.0.1"
31
+ "sakitamanler-ccl-win32": "^1.0.4"
32
32
  }
33
33
  }
@@ -45,7 +45,7 @@ try {
45
45
  console.log(`🔧 正在安装 ${packageName}...`);
46
46
 
47
47
  // 尝试安装平台包
48
- execSync(`npm install -g ${packageName}@1.0.1`, {
48
+ execSync(`npm install -g ${packageName}@1.0.4`, {
49
49
  stdio: 'inherit'
50
50
  });
51
51