Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Add --force option to brew link #12898

Closed
wants to merge 2 commits into from
Closed

Conversation

mistydemeo
Copy link
Member

re: #11811, the first commit here adds a --force option to brew link. This will cause homebrew to delete any conflicting files in the PREFIX before symlinking, similar to the old, destructive brew link behaviour. It also adds a new --dry-run/-n option, similar to git clean, which lists the files --force would delete without making any changes to the filesystem.

The second commit adds a new ARGV.dry_run? helper method, since the option was already being checked for manually in another command, and migrates all usages over to it.

@@ -87,6 +87,9 @@ def interactive?
def one?
flag? '--1'
end
def dryrun?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe dry_run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, closer to the command-line arg.

`brew link` can now be made to delete any conflicting files using
the --force argument. It also has a --dry-run option, similar to
git clean -n, which will list any files which would be deleted
without touching the filesystem.

Closes Homebrew#11811.
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.
@jdelStrother
Copy link

I've longed for something like this for ages. Just used it in anger & it worked nicely, thanks.

@mistydemeo
Copy link
Member Author

Going to commit this tonight if there are no objections!

@mistydemeo mistydemeo closed this in c3285f6 Jul 9, 2012
@mistydemeo
Copy link
Member Author

Apparently "tonight" turned into "a week later"...

Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request Jul 9, 2012
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.

Closes Homebrew#12898.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
eproxus pushed a commit to eproxus/homebrew that referenced this pull request Jul 18, 2012
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.

Closes Homebrew#12898.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.

Closes Homebrew#12898.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants