diff --git a/lib/license_finder/package_managers/cocoa_pods.rb b/lib/license_finder/package_managers/cocoa_pods.rb index 2a7b857b..516b00d6 100644 --- a/lib/license_finder/package_managers/cocoa_pods.rb +++ b/lib/license_finder/package_managers/cocoa_pods.rb @@ -53,7 +53,9 @@ def acknowledgements_path end def read_plist(pathname) - JSON.parse(`plutil -convert json -o - '#{pathname.gsub!(%r{[^0-9A-Za-z.\-'/]}, '')}'`) + transformed_pathname = pathname.gsub!(%r{[^0-9A-Za-z. \-'/]}, '') + transformed_pathname = pathname if transformed_pathname.nil? + JSON.parse(`plutil -convert json -o - '#{transformed_pathname}'`) end end end