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

fix: Update macOS brew list command for casks #58381

Merged
merged 5 commits into from Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/58381.changed
@@ -0,0 +1 @@
Change `brew cask --list` to `brew list --cask`
2 changes: 1 addition & 1 deletion salt/modules/mac_brew_pkg.py
Expand Up @@ -174,7 +174,7 @@ def list_pkgs(versions_as_list=False, **kwargs):
# Grab packages from brew cask, if available.
# Brew Cask doesn't provide a JSON interface, must be parsed the old way.
try:
cask_cmd = "cask list --versions"
cask_cmd = "list --cask --versions"
out = _call_brew(cask_cmd)["stdout"]

for line in out.splitlines():
Expand Down
9 changes: 1 addition & 8 deletions tests/unit/modules/test_mac_brew_pkg.py
@@ -1,17 +1,10 @@
# -*- coding: utf-8 -*-
"""
:codeauthor: Nicole Thomas <nicole@saltstack.com>
"""

# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals

# Import Salt Libs
import salt.modules.mac_brew_pkg as mac_brew
import salt.utils.pkg
from salt.exceptions import CommandExecutionError

# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, Mock, patch
from tests.support.unit import TestCase
Expand Down Expand Up @@ -141,7 +134,7 @@ def custom_call_brew(cmd, failhard=True):
"stderr": "",
"retcode": 0,
}
elif cmd == "cask list --versions":
elif cmd == "list --cask --versions":
result = {
"stdout": "macvim 8.1.151\nfont-firacode-nerd-font 2.0.0",
"stderr": "",
Expand Down