cleanup: add --prune-prefix option.
From https://discourse.brew.sh/t/error-calling-brew-prune-is-disabled/4142/4 and https://github.com/github/homebrew-bootstrap/pull/72 it seems this is worth having as a dedicated flag.
This commit is contained in:
parent
9084a629a5
commit
e7c5d91151
@ -22,6 +22,8 @@ module Homebrew
|
|||||||
description: "Scrub the cache, including downloads for even the latest versions. "\
|
description: "Scrub the cache, including downloads for even the latest versions. "\
|
||||||
"Note downloads for any installed formula or cask will still not be deleted. "\
|
"Note downloads for any installed formula or cask will still not be deleted. "\
|
||||||
"If you want to delete those too: `rm -rf \"$(brew --cache)\"`"
|
"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 :verbose
|
||||||
switch :debug
|
switch :debug
|
||||||
end
|
end
|
||||||
@ -31,6 +33,10 @@ module Homebrew
|
|||||||
cleanup_args.parse
|
cleanup_args.parse
|
||||||
|
|
||||||
cleanup = Cleanup.new(*args.remaining, dry_run: args.dry_run?, scrub: args.s?, days: args.prune&.to_i)
|
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!
|
cleanup.clean!
|
||||||
|
|
||||||
|
@ -23,6 +23,6 @@ module Homebrew
|
|||||||
def prune
|
def prune
|
||||||
prune_args.parse
|
prune_args.parse
|
||||||
|
|
||||||
odisabled("'brew prune'", "'brew cleanup'")
|
odisabled("'brew prune'", "'brew cleanup --prune-prefix'")
|
||||||
end
|
end
|
||||||
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.
|
Show what would be removed, but do not actually remove anything.
|
||||||
* `-s`:
|
* `-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)"`
|
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`*
|
### `command` *`cmd`*
|
||||||
|
|
||||||
|
@ -62,6 +62,10 @@ Show what would be removed, but do not actually remove anything\.
|
|||||||
\fB\-s\fR
|
\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
|
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"
|
.SS "\fBcommand\fR \fIcmd\fR"
|
||||||
Display the path to the file which is used when invoking \fBbrew\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