mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
homebrew: respect greedy flag for cask upgrade_all (#6267)
* homebrew: respect greedy flag for cask upgrade_all * homebrew: implement feedback from code review
This commit is contained in:
parent
ea8720f572
commit
6c5c05dfdc
2 changed files with 13 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- homebrew_cask - allows passing ``--greedy`` option to ``upgrade_all`` (https://github.com/ansible-collections/community.general/pull/6267).
|
|
@ -78,8 +78,9 @@ options:
|
|||
greedy:
|
||||
description:
|
||||
- Upgrade casks that auto update.
|
||||
- Passes --greedy to brew cask outdated when checking
|
||||
if an installed cask has a newer version available.
|
||||
- Passes C(--greedy) to C(brew outdated --cask) when checking
|
||||
if an installed cask has a newer version available,
|
||||
or to C(brew upgrade --cask) when upgrading all casks.
|
||||
type: bool
|
||||
default: false
|
||||
'''
|
||||
|
@ -128,6 +129,11 @@ EXAMPLES = '''
|
|||
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
|
||||
|
@ -581,6 +587,9 @@ class HomebrewCask(object):
|
|||
else:
|
||||
cmd = [self.brew_path, 'cask', 'upgrade']
|
||||
|
||||
if self.greedy:
|
||||
cmd = cmd + ['--greedy']
|
||||
|
||||
rc, out, err = '', '', ''
|
||||
|
||||
if self.sudo_password:
|
||||
|
|
Loading…
Reference in a new issue