Commit 59d3e80
fix(cli): Allow hyphens in semver identifiers and check brew exit code
Fix parseVersion regex to accept hyphens in prerelease and build-metadata
identifiers as required by SemVer 2.0.0, so versions like 1.0.0-alpha-1
or 1.0.0-rc-1+build-hash no longer fail to parse.
Check the exit code of `brew info` before attempting to parse its stdout.
Homebrew exits 0 for missing formulas (a quirk the existing empty-formulae
path handles), but other failure modes like a broken brew install or
permission errors exit non-zero with empty stdout — those now surface a
specific exit-code error instead of a misleading "invalid JSON output".
Reported in PR review by Cursor Bugbot and Sentry.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d6bc364 commit 59d3e80
2 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
205 | 223 | | |
206 | 224 | | |
207 | 225 | | |
| |||
941 | 959 | | |
942 | 960 | | |
943 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
944 | 975 | | |
945 | 976 | | |
946 | 977 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
261 | 267 | | |
262 | 268 | | |
263 | 269 | | |
| |||
0 commit comments