fix(#378): poll scoped package name in update check (#414)

The update worker queried the unscoped 'get-shit-done-redux' via
`npm view`, which returns E404 — so `latest` stayed null and
`update_available` could never become true. Now derives the name from
package.json (`require('../package.json').name`) so it always matches
the actual published scoped name (@opengsd/get-shit-done-redux).

Fixes #378.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-27 21:10:07 -04:00
committed by GitHub
parent 485ea1bd3d
commit 7ea6a06645
3 changed files with 107 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ const fs = require('fs');
const path = require('path');
const { execFileSync } = require('child_process');
const { isSemverNewer } = require('../get-shit-done/bin/lib/semver-compare.cjs');
// Derive the published package name from package.json so this survives
// future renames and always matches the actual registry entry (#378).
const PACKAGE_NAME = require('../package.json').name;
const cacheFile = process.env.GSD_CACHE_FILE;
const projectVersionFile = process.env.GSD_PROJECT_VERSION_FILE;
@@ -79,7 +82,7 @@ if (configDir) {
let latest = null;
try {
latest = execFileSync('npm', ['view', 'get-shit-done-redux', 'version'], {
latest = execFileSync('npm', ['view', PACKAGE_NAME, 'version'], {
encoding: 'utf8',
timeout: 10000,
windowsHide: true,