Commit 36f04d8
Fix file existence checks in adapt_for_older_shakapacker_generator
Fixes CI failures where generator tests fail due to missing files:
- Add File.exist? checks before calling gsub_file on files that may not exist
- Add File.exist? check before renaming shakapacker.yml to webpacker.yml
- Add File.exist? check before modifying commonWebpackConfig.js
The adapt_for_older_shakapacker generator was failing in test environments
where config/shakapacker.yml and other expected files don't exist, causing
"No such file or directory" errors during RSpec generator tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 4ca85b7 commit 36f04d8
File tree
1 file changed
+15
-11
lines changed- lib/generators/react_on_rails
1 file changed
+15
-11
lines changedLines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
0 commit comments