Sha256: 0c2a08f8452bbb38d8f211ea871628bf96113a96c3ac2af67894a68c29a37084

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

Contents

module XCJobs
  module Helper
    def self.extract_provisioning_profile(provisioning_profile)
      if File.file?(provisioning_profile)
        provisioning_profile_path = provisioning_profile
      else
        path = File.join("#{Dir.home}/Library/MobileDevice/Provisioning Profiles/", provisioning_profile)
        if File.file?(path)
          provisioning_profile_path = path
        end
      end
      if provisioning_profile_path
        out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:UUID /dev/stdin <<< $(security cms -D -i "#{provisioning_profile_path}")]
        provisioning_profile_uuid = out.strip if status.success?

        out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:Name /dev/stdin <<< $(security cms -D -i "#{provisioning_profile_path}")]
        provisioning_profile_name = out.strip if status.success?
      else
        provisioning_profile_name = provisioning_profile
      end
      [provisioning_profile_path, provisioning_profile_uuid, provisioning_profile_name]
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
xcjobs-0.1.1 lib/xcjobs/helper.rb
xcjobs-0.1.0 lib/xcjobs/helper.rb
xcjobs-0.0.9 lib/xcjobs/helper.rb
xcjobs-0.0.8 lib/xcjobs/helper.rb
xcjobs-0.0.7 lib/xcjobs/helper.rb
xcjobs-0.0.6 lib/xcjobs/helper.rb
xcjobs-0.0.5 lib/xcjobs/helper.rb
xcjobs-0.0.4 lib/xcjobs/helper.rb