mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6267/6c5c05df backport][stable-6] homebrew: respect greedy flag for cask upgrade_all (#6328)
homebrew: respect greedy flag for cask upgrade_all (#6267)
* homebrew: respect greedy flag for cask upgrade_all
* homebrew: implement feedback from code review
(cherry picked from commit 6c5c05dfdc
)
Co-authored-by: Claude Becker <becker@phys.ethz.ch>
This commit is contained in:
parent
be96c33257
commit
923d335646
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:
|
greedy:
|
||||||
description:
|
description:
|
||||||
- Upgrade casks that auto update.
|
- Upgrade casks that auto update.
|
||||||
- Passes --greedy to brew cask outdated when checking
|
- Passes C(--greedy) to C(brew outdated --cask) when checking
|
||||||
if an installed cask has a newer version available.
|
if an installed cask has a newer version available,
|
||||||
|
or to C(brew upgrade --cask) when upgrading all casks.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
'''
|
'''
|
||||||
|
@ -128,6 +129,11 @@ EXAMPLES = '''
|
||||||
community.general.homebrew_cask:
|
community.general.homebrew_cask:
|
||||||
upgrade_all: true
|
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
|
- name: Upgrade given cask with force option
|
||||||
community.general.homebrew_cask:
|
community.general.homebrew_cask:
|
||||||
name: alfred
|
name: alfred
|
||||||
|
@ -581,6 +587,9 @@ class HomebrewCask(object):
|
||||||
else:
|
else:
|
||||||
cmd = [self.brew_path, 'cask', 'upgrade']
|
cmd = [self.brew_path, 'cask', 'upgrade']
|
||||||
|
|
||||||
|
if self.greedy:
|
||||||
|
cmd = cmd + ['--greedy']
|
||||||
|
|
||||||
rc, out, err = '', '', ''
|
rc, out, err = '', '', ''
|
||||||
|
|
||||||
if self.sudo_password:
|
if self.sudo_password:
|
||||||
|
|
Loading…
Reference in a new issue