aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/unlinkapps.rb15
-rw-r--r--Library/Homebrew/manpages/brew.1.md23
2 files changed, 25 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/unlinkapps.rb b/Library/Homebrew/cmd/unlinkapps.rb
index 86a816050..68ee9d94e 100644
--- a/Library/Homebrew/cmd/unlinkapps.rb
+++ b/Library/Homebrew/cmd/unlinkapps.rb
@@ -4,13 +4,14 @@ module Homebrew
def unlinkapps
target_dir = linkapps_target(:local => ARGV.include?("--local"))
- unlinkapps_from_dir(target_dir)
+ unlinkapps_from_dir(target_dir, :dry_run => ARGV.dry_run?)
end
private
- def unlinkapps_from_dir(target_dir)
+ def unlinkapps_from_dir(target_dir, opts = {})
return unless target_dir.directory?
+ dry_run = opts.fetch(:dry_run, false)
apps = Pathname.glob("#{target_dir}/*.app").select do |app|
unlinkapps_unlink?(app)
@@ -20,10 +21,16 @@ module Homebrew
apps.each do |app|
app.extend(ObserverPathnameExtension)
- puts "Unlinking: #{app}"
- app.unlink
+ if dry_run
+ puts "Would unlink: #{app}"
+ else
+ puts "Unlinking: #{app}"
+ app.unlink
+ end
end
+ return if dry_run
+
if ObserverPathnameExtension.total.zero?
puts "No apps unlinked from #{target_dir}" if ARGV.verbose?
else
diff --git a/Library/Homebrew/manpages/brew.1.md b/Library/Homebrew/manpages/brew.1.md
index 47b0517ef..9e3c2cd07 100644
--- a/Library/Homebrew/manpages/brew.1.md
+++ b/Library/Homebrew/manpages/brew.1.md
@@ -267,14 +267,13 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--force` is passed, Homebrew will allow keg-only formulae to be linked.
* `linkapps` [`--local`] [<formulae>]:
- Find installed formulae that have compiled `.app`-style "application"
- packages for OS X, and symlink those apps into `/Applications`, allowing
- for easier access.
+ Find installed formulae that provide `.app`-style OS X apps and symlink them
+ into `/Applications`, allowing for easier access.
- If no <formulae> are provided, all of them will have their .apps symlinked.
+ If no <formulae> are provided, all of them will have their apps symlinked.
- If provided, `--local` will move them into the user's `~/Applications`
- directory instead of the system directory. It may need to be created, first.
+ If provided, `--local` will symlink them into the user's `~/Applications`
+ directory instead of the system directory.
* `ls`, `list` [`--full-name`]:
List all installed formulae. If `--full-name` is passed, print formulae with
@@ -451,10 +450,16 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--dry-run` or `-n` is passed, Homebrew will list all files which would
be unlinked, but will not actually unlink or delete any files.
- * `unlinkapps` [`--local`] [<formulae>]:
- Removes links created by `brew linkapps`.
+ * `unlinkapps` [`--local`] [`--dry-run`] [<formulae>]:
+ Remove symlinks created by `brew linkapps` from `/Applications`.
- If no <formulae> are provided, all linked app will be removed.
+ If no <formulae> are provided, all linked apps will be removed.
+
+ If provided, `--local` will remove symlinks from the user's `~/Applications`
+ directory instead of the system directory.
+
+ If `--dry-run` or `-n` is passed, Homebrew will list all symlinks which
+ would be removed, but will not actually delete any files.
* `unpack` [`--git`|`--patch`] [`--destdir=`<path>] <formulae>:
Unpack the source files for <formulae> into subdirectories of the current