@cometix/ccline
Advanced tools
+6
-6
| { | ||
| "name": "@cometix/ccline", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "CCometixLine - High-performance Claude Code StatusLine tool", | ||
@@ -12,7 +12,7 @@ "bin": { | ||
| "optionalDependencies": { | ||
| "@cometix/ccline-darwin-x64": "1.0.0", | ||
| "@cometix/ccline-darwin-arm64": "1.0.0", | ||
| "@cometix/ccline-linux-x64": "1.0.0", | ||
| "@cometix/ccline-linux-x64-musl": "1.0.0", | ||
| "@cometix/ccline-win32-x64": "1.0.0" | ||
| "@cometix/ccline-darwin-x64": "1.0.1", | ||
| "@cometix/ccline-darwin-arm64": "1.0.1", | ||
| "@cometix/ccline-linux-x64": "1.0.1", | ||
| "@cometix/ccline-linux-x64-musl": "1.0.1", | ||
| "@cometix/ccline-win32-x64": "1.0.1" | ||
| }, | ||
@@ -19,0 +19,0 @@ "repository": { |
@@ -73,6 +73,53 @@ const fs = require('fs'); | ||
| const binaryName = platform === 'win32' ? 'ccline.exe' : 'ccline'; | ||
| const sourcePath = path.join(__dirname, '..', 'node_modules', packageName, binaryName); | ||
| const targetPath = path.join(claudeDir, binaryName); | ||
| if (!fs.existsSync(sourcePath)) { | ||
| // Multiple path search strategies for different package managers | ||
| const findBinaryPath = () => { | ||
| const possiblePaths = [ | ||
| // npm/yarn: nested in node_modules | ||
| path.join(__dirname, '..', 'node_modules', packageName, binaryName), | ||
| // pnpm: try require.resolve first | ||
| (() => { | ||
| try { | ||
| const packagePath = require.resolve(packageName + '/package.json'); | ||
| return path.join(path.dirname(packagePath), binaryName); | ||
| } catch { | ||
| return null; | ||
| } | ||
| })(), | ||
| // pnpm: flat structure fallback with version detection | ||
| (() => { | ||
| const currentPath = __dirname; | ||
| const pnpmMatch = currentPath.match(/(.+\.pnpm)[\\/]([^\\//]+)[\\/]/); | ||
| if (pnpmMatch) { | ||
| const pnpmRoot = pnpmMatch[1]; | ||
| const packageNameEncoded = packageName.replace('/', '+'); | ||
| try { | ||
| // Try to find any version of the package | ||
| const pnpmContents = fs.readdirSync(pnpmRoot); | ||
| const packagePattern = new RegExp(`^${packageNameEncoded.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}@`); | ||
| const matchingPackage = pnpmContents.find(dir => packagePattern.test(dir)); | ||
| if (matchingPackage) { | ||
| return path.join(pnpmRoot, matchingPackage, 'node_modules', packageName, binaryName); | ||
| } | ||
| } catch { | ||
| // Fallback to current behavior if directory reading fails | ||
| } | ||
| } | ||
| return null; | ||
| })() | ||
| ].filter(p => p !== null); | ||
| for (const testPath of possiblePaths) { | ||
| if (fs.existsSync(testPath)) { | ||
| return testPath; | ||
| } | ||
| } | ||
| return null; | ||
| }; | ||
| const sourcePath = findBinaryPath(); | ||
| if (!sourcePath) { | ||
| if (!silent) { | ||
@@ -79,0 +126,0 @@ console.log('Binary package not installed, skipping Claude Code setup'); |
9635
20.06%220
24.29%