mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
fixes brew json parsing
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
This commit is contained in:
parent
74ed60ce5f
commit
08e182843b
1 changed files with 4 additions and 2 deletions
|
@ -143,11 +143,13 @@ module Inspec::Resources
|
|||
# parse data
|
||||
pkg = JSON.parse(cmd.stdout)[0]
|
||||
{
|
||||
name: pkg.name.to_s,
|
||||
name: pkg['name'],
|
||||
installed: true,
|
||||
version: pkg.installed.version.to_s,
|
||||
version: pkg['installed'][0]['version'],
|
||||
type: 'brew',
|
||||
}
|
||||
rescue JSON::ParserError => _e
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue