Merge pull request #5721 from MikeMcQuaid/prune-prefix
cleanup: add --prune-prefix option.
This commit is contained in:
		
						commit
						d3a1554805
					
				@ -22,6 +22,8 @@ module Homebrew
 | 
			
		||||
        description: "Scrub the cache, including downloads for even the latest versions. "\
 | 
			
		||||
                     "Note downloads for any installed formula or cask will still not be deleted. "\
 | 
			
		||||
                     "If you want to delete those too: `rm -rf \"$(brew --cache)\"`"
 | 
			
		||||
      switch "--prune-prefix",
 | 
			
		||||
        description: "Only prune the symlinks and directories from the prefix and remove no other files."
 | 
			
		||||
      switch :verbose
 | 
			
		||||
      switch :debug
 | 
			
		||||
    end
 | 
			
		||||
@ -31,6 +33,10 @@ module Homebrew
 | 
			
		||||
    cleanup_args.parse
 | 
			
		||||
 | 
			
		||||
    cleanup = Cleanup.new(*args.remaining, dry_run: args.dry_run?, scrub: args.s?, days: args.prune&.to_i)
 | 
			
		||||
    if args.prune_prefix?
 | 
			
		||||
      cleanup.prune_prefix_symlinks_and_directories
 | 
			
		||||
      return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    cleanup.clean!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,6 @@ module Homebrew
 | 
			
		||||
  def prune
 | 
			
		||||
    prune_args.parse
 | 
			
		||||
 | 
			
		||||
    odisabled("'brew prune'", "'brew cleanup'")
 | 
			
		||||
    odisabled("'brew prune'", "'brew cleanup --prune-prefix'")
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,8 @@ only do this for the specified formulae and casks.
 | 
			
		||||
  Show what would be removed, but do not actually remove anything.
 | 
			
		||||
* `-s`:
 | 
			
		||||
  Scrub the cache, including downloads for even the latest versions. Note downloads for any installed formula or cask will still not be deleted. If you want to delete those too: `rm -rf "$(brew --cache)"`
 | 
			
		||||
* `--prune-prefix`:
 | 
			
		||||
  Only prune the symlinks and directories from the prefix and remove no other files.
 | 
			
		||||
 | 
			
		||||
### `command` *`cmd`*
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -62,6 +62,10 @@ Show what would be removed, but do not actually remove anything\.
 | 
			
		||||
\fB\-s\fR
 | 
			
		||||
Scrub the cache, including downloads for even the latest versions\. Note downloads for any installed formula or cask will still not be deleted\. If you want to delete those too: \fBrm \-rf "$(brew \-\-cache)"\fR
 | 
			
		||||
.
 | 
			
		||||
.TP
 | 
			
		||||
\fB\-\-prune\-prefix\fR
 | 
			
		||||
Only prune the symlinks and directories from the prefix and remove no other files\.
 | 
			
		||||
.
 | 
			
		||||
.SS "\fBcommand\fR \fIcmd\fR"
 | 
			
		||||
Display the path to the file which is used when invoking \fBbrew\fR \fIcmd\fR\.
 | 
			
		||||
.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user