Skip to content

[1.1.0] Fix KeyError and add platform-aware downloads - #22

Merged
unurgunite merged 2 commits into
v1.1.0from
fix/unable-install-phpstorm
Aug 8, 2026
Merged

[1.1.0] Fix KeyError and add platform-aware downloads#22
unurgunite merged 2 commits into
v1.1.0from
fix/unable-install-phpstorm

Conversation

@unurgunite

@unurgunite unurgunite commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes KeyError: Missing hash key when using --upgrade-ide with JetBrains products not present in a hardcoded map (e.g. PhpStorm), and makes IDE downloads platform-aware (macOS / Linux / Windows instead of always .dmg).

Fixes #21.

Changes

  • Utils.product_code — single case-insensitive {product=>code} mapping (PhpStorm->PS, IntelliJ->IU, Rider ->RD, etc.) with safe fallback. DetectProducts.infer_code and IDEUpdater now share it instead of two divergent maps.
  • ide_updater.cr--upgrade-ide:
    • no more Hash#[] KeyError crash on unknown/lowercase product names (phpstorm via --ide-path now resolves correctly);
    • download key chosen by OS + arch: mac/macM1, linux/linuxARM64, windows (previously always .dmg);
    • saved file extension follows the platform.
  • main.cr--list-ide-releases normalizes the product code too (phpstorm works).
  • CI — pin Crystal to 1.17.1 (matching .tool-versions); ameba 1.6.4 doesn't build under Crystal 1.21 (preview_mt removed, Lexer#next_string_array_token gone).
  • shard.lockuing 0.1.1 -> 0.1.2.
  • SpecsUtils.product_code coverage (mapping, lowercase, fallback).

Verification

  • crystal spec — 94 examples, 0 failures
  • bin/ameba — 26 files inspected, 0 failures
  • Manual: --product PhpStorm --upgrade-ide fetches PS (no KeyError)
  • Manual: --ide-path /Applications/phpstorm --upgrade-ide -> PHPS... -> PS

@unurgunite unurgunite self-assigned this Aug 7, 2026
@unurgunite unurgunite added the enhancement New feature or request label Aug 7, 2026
@unurgunite unurgunite linked an issue Aug 7, 2026 that may be closed by this pull request
@unurgunite
unurgunite merged commit 124ec49 into v1.1.0 Aug 8, 2026
10 checks passed
@unurgunite
unurgunite deleted the fix/unable-install-phpstorm branch August 8, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error "Missing hash key" on PhpStorm update attempt

1 participant