Skip to content

refactor(runtime): remove hardcoded system paths from DetectInstalled#127

Merged
CalvinAllen merged 1 commit into
mainfrom
refactor/runtime/remove-hardcoded-paths
Dec 13, 2025
Merged

refactor(runtime): remove hardcoded system paths from DetectInstalled#127
CalvinAllen merged 1 commit into
mainfrom
refactor/runtime/remove-hardcoded-paths

Conversation

@CalvinAllen

Copy link
Copy Markdown
Contributor

Summary

  • Remove redundant hardcoded installation paths from all three runtime providers
  • Simplify DetectInstalled() to only use PATH detection and version manager detection
  • Remove maintenance burden of keeping hardcoded paths up to date

Removed Functions

Provider Function Removed
Node.js getNodeInstallLocations()
Python getPythonInstallLocations()
Ruby getRubyInstallLocations()

Rationale

These hardcoded paths were redundant because:

  1. If the install is in PATH - LookPathExcludingShims() already finds it
  2. If the install is NOT in PATH - It's not usable anyway, no point migrating it

The hardcoded paths also had maintenance problems:

  • Incomplete (miss future versions like Python 3.13, Ruby 3.4)
  • Don't handle custom installation paths
  • Inconsistent across providers
  • Add code complexity without value

Test plan

  • All existing tests pass
  • Linting passes
  • DetectInstalled() still detects:
    • System installs in PATH
    • nvm/fnm installed Node.js versions
    • pyenv installed Python versions
    • rbenv/rvm/chruby installed Ruby versions

Closes #124

Remove redundant hardcoded installation paths from all three runtime
providers. These paths are redundant because:

1. If the install is in PATH, LookPathExcludingShims() already finds it
2. If the install is NOT in PATH, it's not usable anyway

Removed functions:
- getNodeInstallLocations() from Node.js provider
- getPythonInstallLocations() from Python provider
- getRubyInstallLocations() from Ruby provider

This simplifies the code and removes maintenance burden of keeping
hardcoded paths up to date with new runtime versions.

Closes #124
@CalvinAllen CalvinAllen merged commit 04dc845 into main Dec 13, 2025
12 checks passed
@CalvinAllen CalvinAllen deleted the refactor/runtime/remove-hardcoded-paths branch December 13, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

refactor(runtime): remove hardcoded system paths from DetectInstalled

1 participant