Skip to content

Commit ffd18c7

Browse files
justin808claude
andcommitted
Fix: Use --force flag instead of THOR_MERGE environment variable
The THOR_MERGE=always environment variable wasn't preventing interactive prompts. Changed to use the --force flag which is the standard Thor way to force overwrite of existing files without prompting. This fixes the issue where shakapacker.yml was still prompting for overwrite during react_on_rails:install. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2a901e0 commit ffd18c7

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

lib/demo_scripts/demo_creator.rb

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,21 +327,13 @@ def install_react_on_rails
327327
# Remove files that will conflict with React on Rails generator
328328
cleanup_conflicting_files
329329

330-
base_args = ['--ignore-warnings']
330+
base_args = ['--ignore-warnings', '--force']
331331
all_args = (base_args + @react_on_rails_args).join(' ')
332332

333-
# Set THOR_MERGE=always to force overwrite without prompting
334-
if @dry_run
335-
@runner.run!(
336-
"bin/rails generate react_on_rails:install #{all_args}",
337-
dir: @demo_dir
338-
)
339-
else
340-
@runner.run!(
341-
"THOR_MERGE=always bin/rails generate react_on_rails:install #{all_args}",
342-
dir: @demo_dir
343-
)
344-
end
333+
@runner.run!(
334+
"bin/rails generate react_on_rails:install #{all_args}",
335+
dir: @demo_dir
336+
)
345337
end
346338

347339
def cleanup_conflicting_files

0 commit comments

Comments
 (0)