-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Support link: :overwrite
option
#1455
base: master
Are you sure you want to change the base?
Conversation
- set `link: :overwrite` per formula to use `brew link --overwrite` to force linking and overwrite all conflicting files - use the linked? and keg_only? predicates available from Formula - `--force` should only be passed when it's keg-only - check linked/unlinked state to avoid re-calling `brew link`\`brew unlink`
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.
Thanks @yelsa! Looking good so far.
# 'brew install --with-rmtp', 'brew services restart' on version changes | ||
brew "denji/nginx/nginx-full", args: ["with-rmtp"], restart_service: :changed | ||
# 'brew install --with-rmtp', 'brew link --overwrite', 'brew services restart' on version changes | ||
brew "denji/nginx/nginx-full", link: :overwrite, args: ["with-rmtp"], restart_service: :changed |
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.
Not sure about this DSL; having true
/false
/:overwrite
as valid values is a bit confusing. Thoughts about link_overwrite: true
instead?
end | ||
end | ||
|
||
if cmd |
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.
if cmd | |
if cmd.present? |
when true | ||
unless linked_and_keg_only? | ||
puts "Force-linking #{@name} formula." if verbose |
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.
This seems like a behaviour, maybe messaging, change? Can you detail the expected changes in behaviour/messaging? Thanks!
link: :overwrite
per formulabrew link --overwrite
to force linking and overwrite all conflicting fileslinked?
andkeg_only?
predicates available fromFormula
--force
should only be passed when it's keg-onlybrew link
/brew unlink
Closes #1062
Resolves #1116 (comment), #1116 (comment)