fix: local-wp --help silently exits 1 with zero output#125
Merged
Conversation
…exist Co-authored-by: noelsaw1 <56978803+noelsaw1@users.noreply.github.com> Agent-Logs-Url: https://github.com/Hypercart-Dev-Tools/WP-Code-Check/sessions/c90657a7-3ee2-4aca-8105-cfb054ff53df
Copilot
AI
changed the title
[WIP] Fix silent crash when running local-wp --help
fix: local-wp --help silently exits 1 with zero output
Mar 24, 2026
noelsaw1
added a commit
that referenced
this pull request
Mar 24, 2026
local-wp is a WP-CLI wrapper for Local by Flywheel and lives in AI-DDTK (bin/local-wp). It was mistakenly added to WPCC's dist/bin/ by Copilot in PR #125. WPCC's dist/bin/ is for scanner-related scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
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.
local-wp --help(and every invocation) silently crashed underset -ebecausedetect_php_binreturned exit code 1 when no macOS Local by Flywheel PHP directories exist — killing the script before any output was produced.Root cause
Any invocation on a system without Local installed (Linux, CI, fresh macOS) hit this on the way to the argument parser — including
--help.Changes (
dist/bin/local-wp)--help/-hhandled before PHP detection — early arg scan at the top exits cleanly beforedetect_php_binis ever calleddetect_php_binalways returns 0 — explicitreturn 0on every path; empty stdout signals "not found"|| trueguard onPHP_BINassignment — belt-and-suspenders against any future regression:PHP_BIN="${PHP_BIN:-$(detect_php_bin || true)}"📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.