From 2c223d96a190c56e33adeab5133855ae14a3e081 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 5 Dec 2025 13:44:52 +0900 Subject: [PATCH] feat(comment-checker): add Windows support --- package.json | 2 +- src/hooks/comment-checker/cli.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4b1e14f..4c82f6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oh-my-opencode", - "version": "0.1.12", + "version": "0.1.13", "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/hooks/comment-checker/cli.ts b/src/hooks/comment-checker/cli.ts index fe282cd..e965dea 100644 --- a/src/hooks/comment-checker/cli.ts +++ b/src/hooks/comment-checker/cli.ts @@ -25,18 +25,26 @@ function getPlatformPackageName(): string | null { "darwin-x64": "@code-yeongyu/comment-checker-darwin-x64", "linux-arm64": "@code-yeongyu/comment-checker-linux-arm64", "linux-x64": "@code-yeongyu/comment-checker-linux-x64", + "win32-x64": "@code-yeongyu/comment-checker-windows-x64", + "win32-arm64": "@code-yeongyu/comment-checker-windows-arm64", } return platformMap[`${platform}-${arch}`] ?? null } +function getBinaryName(): string { + return process.platform === "win32" ? "comment-checker.exe" : "comment-checker" +} + function findCommentCheckerPath(): string | null { + const binaryName = getBinaryName() + // 1. Try to find from @code-yeongyu/comment-checker package try { const require = createRequire(import.meta.url) const cliPkgPath = require.resolve("@code-yeongyu/comment-checker/package.json") const cliDir = dirname(cliPkgPath) - const binaryPath = join(cliDir, "bin", "comment-checker") + const binaryPath = join(cliDir, "bin", binaryName) if (existsSync(binaryPath)) { debugLog("found binary in main package:", binaryPath) @@ -46,14 +54,14 @@ function findCommentCheckerPath(): string | null { debugLog("main package not installed") } - // 2. Try platform-specific package directly + // 2. Try platform-specific package directly (legacy, for backwards compatibility) const platformPkg = getPlatformPackageName() if (platformPkg) { try { const require = createRequire(import.meta.url) const pkgPath = require.resolve(`${platformPkg}/package.json`) const pkgDir = dirname(pkgPath) - const binaryPath = join(pkgDir, "bin", "comment-checker") + const binaryPath = join(pkgDir, "bin", binaryName) if (existsSync(binaryPath)) { debugLog("found binary in platform package:", binaryPath)