Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homebrew: respect greedy flag for cask upgrade_all #6267

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- homebrew_cask - allows passing --greedy option to upgrade_all
11 changes: 10 additions & 1 deletion plugins/modules/homebrew_cask.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
description:
- Upgrade casks that auto update.
- Passes --greedy to brew cask outdated when checking
if an installed cask has a newer version available.
if an installed cask has a newer version available,
or to brew cask upgrade when upgrading all casks.
type: bool
default: false
'''
Expand Down Expand Up @@ -128,6 +129,11 @@
community.general.homebrew_cask:
upgrade_all: true

- name: Upgrade all casks with greedy option
community.general.homebrew_cask:
upgrade_all: true
greedy: true

- name: Upgrade given cask with force option
community.general.homebrew_cask:
name: alfred
Expand Down Expand Up @@ -581,6 +587,9 @@ def _upgrade_all(self):
else:
cmd = [self.brew_path, 'cask', 'upgrade']

if self.greedy:
cmd = cmd + ['--greedy']

rc, out, err = '', '', ''

if self.sudo_password:
Expand Down