-
-
Notifications
You must be signed in to change notification settings - Fork 105
Add SKIP=true installer mode to preserve existing files #893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
a9509c2
8625eaa
76498b1
b2aa54a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,13 @@ | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install Shakapacker | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| force_option = ENV["FORCE"] ? { force: true } : {} | ||||||||||||||||||||||||||||||
| force_option = if ENV["FORCE"] | ||||||||||||||||||||||||||||||
| { force: true } | ||||||||||||||||||||||||||||||
| elsif ENV["SKIP"] | ||||||||||||||||||||||||||||||
| { skip: true } | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| {} | ||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| force_option = if ENV["FORCE"] | |
| { force: true } | |
| elsif ENV["SKIP"] | |
| { skip: true } | |
| else | |
| {} | |
| end | |
| conflict_option = if ENV["FORCE"] | |
| { force: true } | |
| elsif ENV["SKIP"] | |
| { skip: true } | |
| else | |
| {} | |
| end |
Note: This would also require updating the three references to force_option on lines 40, 62, and the corresponding variable in lib/install/binstubs.rb (line 10).
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENV["SKIP"] is truthy for any value, including "false" or "0".
ENV["SKIP"] returns a non-nil string for any set value, so SKIP=false bundle exec rake shakapacker:install would still activate skip mode. Consider checking for explicit truthy values to match the documented SKIP=true usage. The same applies to ENV["FORCE"], though that's pre-existing behavior.
Proposed fix
-conflict_option = if ENV["FORCE"]
+conflict_option = if ENV["FORCE"] == "true"
{ force: true }
-elsif ENV["SKIP"]
+elsif ENV["SKIP"] == "true"
{ skip: true }
else
{}
end🤖 Prompt for AI Agents
In `@lib/install/template.rb` around lines 10 - 16, The code currently treats any
set ENV["SKIP"] or ENV["FORCE"] as truthy (so "false" or "0" still activates),
so update the conflict_option logic to test for explicit truthy strings (e.g.
check ENV["SKIP"] && %w[true 1 yes].include?(ENV["SKIP"].to_s.downcase)) and do
the same for ENV["FORCE"] (or extract a small helper like truthy_env?(name)) so
only intended values like "true"/"1"/"yes" enable skip/force in the
conflict_option branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider documenting FORCE+SKIP precedence
The PR description states that
FORCEwins when both are set, which is a useful detail for users. Consider adding this to the documentation, e.g.: "If both are set,FORCE=truetakes precedence."Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!