Merge pull request #8312 from maxim-belkin/fix-cleanup
cleanup: fix input handling Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
commit
e5e7a9a7e9
@ -33,6 +33,10 @@ module Homebrew
|
||||
def cleanup
|
||||
args = cleanup_args.parse
|
||||
|
||||
if args.prune.present? && !Integer(args.prune, exception: false) && args.prune != "all"
|
||||
raise UsageError, "--prune= expects an integer or 'all'."
|
||||
end
|
||||
|
||||
cleanup = Cleanup.new(*args.named, dry_run: args.dry_run?, scrub: args.s?, days: args.prune&.to_i)
|
||||
if args.prune_prefix?
|
||||
cleanup.prune_prefix_symlinks_and_directories
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user