From c033a85e4aa62776aa47897791dc8cea15a27334 Mon Sep 17 00:00:00 2001 From: Santeri Helminen <93415320+SanteriHelminen@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:52:36 +0200 Subject: [PATCH] fix(hooks): update check now finds VERSION in local project installs (#166) The update check script always looked for VERSION in ~/.claude/get-shit-done/, but GSD can be installed locally in ./.claude/get-shit-done/. This caused false "update available" notifications when using local installations. Changes: - Check project directory first, then fall back to global - Remove unused execSync import --- hooks/gsd-check-update.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hooks/gsd-check-update.js b/hooks/gsd-check-update.js index d8e30c547..1cfc1ab50 100755 --- a/hooks/gsd-check-update.js +++ b/hooks/gsd-check-update.js @@ -5,12 +5,16 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const { execSync, spawn } = require('child_process'); +const { spawn } = require('child_process'); const homeDir = os.homedir(); +const cwd = process.cwd(); const cacheDir = path.join(homeDir, '.claude', 'cache'); const cacheFile = path.join(cacheDir, 'gsd-update-check.json'); -const versionFile = path.join(homeDir, '.claude', 'get-shit-done', 'VERSION'); + +// VERSION file locations (check project first, then global) +const projectVersionFile = path.join(cwd, '.claude', 'get-shit-done', 'VERSION'); +const globalVersionFile = path.join(homeDir, '.claude', 'get-shit-done', 'VERSION'); // Ensure cache directory exists if (!fs.existsSync(cacheDir)) { @@ -23,11 +27,17 @@ const child = spawn(process.execPath, ['-e', ` const { execSync } = require('child_process'); const cacheFile = ${JSON.stringify(cacheFile)}; - const versionFile = ${JSON.stringify(versionFile)}; + const projectVersionFile = ${JSON.stringify(projectVersionFile)}; + const globalVersionFile = ${JSON.stringify(globalVersionFile)}; + // Check project directory first (local install), then global let installed = '0.0.0'; try { - installed = fs.readFileSync(versionFile, 'utf8').trim(); + if (fs.existsSync(projectVersionFile)) { + installed = fs.readFileSync(projectVersionFile, 'utf8').trim(); + } else if (fs.existsSync(globalVersionFile)) { + installed = fs.readFileSync(globalVersionFile, 'utf8').trim(); + } } catch (e) {} let latest = null;