Skip to content

Commit f2e551c

Browse files
justin808claude
andcommitted
Fix script/convert to support both old and new file locations
The script/convert is used by CI minimum dependency tests. After moving files into react_on_rails/ directory, the script needs to work with both: - Old structure (before PR merges): Gemfile.development_dependencies at root - New structure (after PR merges): Gemfile.development_dependencies in react_on_rails/ Added fallback logic to try the old location if new location doesn't exist. This ensures CI passes for this PR and continues to work after merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 46d49a2 commit f2e551c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

script/convert

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33

44
def gsub_file_content(path, old_content, new_content)
55
path = File.expand_path(path, __dir__)
6+
7+
# Support both old structure (files at root) and new structure (files in react_on_rails/)
8+
# This allows the script to work before and after the monorepo reorganization
9+
unless File.exist?(path)
10+
# Try the old location by removing one level of nesting
11+
old_path = path.sub(%r{/react_on_rails/Gemfile}, "/Gemfile")
12+
path = old_path if File.exist?(old_path)
13+
end
14+
615
content = File.binread(path)
716
content.gsub!(old_content, new_content)
817
File.binwrite(path, content)

0 commit comments

Comments
 (0)