fix(installer): install the CLI on macOS and Windows - #166
Merged
Conversation
The installer never installed the CLI on macOS or Windows. detect_os returns Darwin there, which set PLATFORM_KIND=desktop-client and took a branch that skipped install_global_package "$PKG_NAME" entirely and instead ran `pnpm add -g @profullstack/threatcrush-desktop`. That package has never been published to npm — apps/desktop is an Electron app shipped to GitHub Releases as .dmg / .exe / .AppImage / .deb. So the install 404'd, and under `set -e` the 404 aborted the whole script, leaving the machine with no threatcrush at all: ERR_PNPM_FETCH_404 GET .../@profullstack%2Fthreatcrush-desktop Always install the CLI, on every platform. When the machine is a desktop, point at the matching GitHub Releases asset instead of pretending the bundle is an npm package. Same fix in `threatcrush update`, which pushed the same nonexistent package onto its update command list. `remove` is untouched — it already guards on packageLooksInstalled. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TuQfdnSCZAC5bDTCgTwSVW
ThreatCrush Security Scan12 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 6 | LOW: 5
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The install script at https://threatcrush.com/install.sh fails outright on macOS, leaving the machine with no
threatcrushat all:Cause
detect_osreturnsDarwinon macOS, which setsPLATFORM_KIND=desktop-client. That took a branch which skippedinstall_global_package "$PKG_NAME"entirely and instead ranpnpm add -g @profullstack/threatcrush-desktop.That package has never been published to npm.
apps/desktopis an Electron app shipped to GitHub Releases as.dmg/.exe/.AppImage/.deb(seedesktop-release.yml, and the assets onv0.11.4). Underset -ethe 404 aborted the whole script.Windows hits the same branch. Linux desktop was less bad — it installed the CLI first, then aborted on the same 404.
Fix
install_global_package "$PKG_NAME", on every platform. The CLI is a plain Node package and runs fine on macOS.install_desktop_bundle(npm) withannounce_desktop_bundle, which prints the matching GitHub Releases asset for the detected OS/arch. Never fatal.detect_archso the pointer is right on Apple Silicon vs Intel.threatcrush update, which pushed the same nonexistent package onto its command list.removeis untouched — it already guards onpackageLooksInstalled.Verification
sh -nclean; simulated runs with stubbeduname/pnpmfor Darwin/arm64 and Linux/x86_64 — both install the CLI and exit 0; the macOS run correctly namesthreatcrush-desktop-<version>-arm64.dmg.install-script.test.tsupdated and passing (6/6). It now asserts the script contains no reference to the unpublished package.next buildincluding TypeScript.🤖 Generated with Claude Code
https://claude.ai/code/session_01TuQfdnSCZAC5bDTCgTwSVW