1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Handle homebrew_cask "nothing to list" corner case.

This commit is contained in:
Daniel Jaouen 2014-02-19 18:49:25 -05:00
parent f7c3847391
commit 8a612ba5d4

View file

@ -327,7 +327,9 @@ class HomebrewCask(object):
cmd = [self.brew_path, 'cask', 'list']
rc, out, err = self.module.run_command(cmd)
if rc == 0:
if 'nothing to list' in out:
return True
elif rc == 0:
casks = [cask_.strip() for cask_ in out.split('\n') if cask_.strip()]
return self.current_cask in casks
else: