Commit 40dab84
Add rvm and nvm support to ci-switch-config (#1986)
## Summary
- Add support for rvm (Ruby Version Manager) and nvm (Node Version
Manager) to the `bin/ci-switch-config` script
- Previously only supported mise and asdf version managers
- Makes the script more flexible for developers using different version
management tools
## Key Changes
- Enhanced `check_version_manager()` to detect rvm, nvm, or rvm+nvm
combinations
- Added `set_ruby_version()` helper function to switch Ruby versions
with rvm
- Added `set_node_version()` helper function to switch Node versions
with nvm
- Updated `switch_to_minimum()` to use new helper functions
- Updated `restore_to_latest()` to use new helper functions
- Added appropriate shell reload/verification instructions for each
version manager
## How It Works
The script now detects version managers in this priority order:
1. mise (recommended)
2. asdf
3. rvm + nvm (both installed)
4. rvm only
5. nvm only
For rvm/nvm users:
- Automatically installs missing Ruby/Node versions if needed
- Sources nvm if not already loaded in the environment
- Uses `rvm use` and `nvm use` to switch versions
- Provides appropriate verification commands
## Test Plan
- [x] Syntax validation passes (`bash -n bin/ci-switch-config`)
- [x] Status command works correctly
- [x] RuboCop passes with zero offenses
- [x] Pre-commit hooks pass
- [x] File ends with proper newline
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/1986)
<!-- Reviewable:end -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Support for multiple version managers (mise, asdf, rvm, nvm),
including mixed rvm+nvm setups, with per-manager flows to set/apply Ruby
and Node and status visibility for runtimes.
* **Bug Fixes**
* Improved messaging and error handling when managers or versions are
missing; clearer manager-specific reload/current-version guidance.
* **Documentation**
* Revised switching guide with setup options, rvm+nvm notes,
manager-specific commands, examples, and expanded troubleshooting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b659390 commit 40dab84
2 files changed
+309
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | | - | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | | - | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
74 | 103 | | |
75 | 104 | | |
76 | 105 | | |
| |||
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
110 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
111 | 142 | | |
112 | 143 | | |
113 | 144 | | |
| |||
137 | 168 | | |
138 | 169 | | |
139 | 170 | | |
140 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
| |||
243 | 276 | | |
244 | 277 | | |
245 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
246 | 295 | | |
247 | 296 | | |
248 | 297 | | |
| |||
0 commit comments