Class: Fastlane::Actions::EnProfileNameAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/ciutils/actions/en_profile_name.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



50
51
52
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 50

def self.authors
  ["Nicolae Ghimbovschi"]
end

.available_optionsObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 33

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "FL_EN_PROFILE_PATH",
                                 description: "Path to the provisioning profile",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :uuid,
                                 env_name: "FL_EN_PROFILE_UUID",
                                 description: "The UUID of the provisioning profile from 'Provisioning Profiles' folder",
                                 optional: true)
  ]
end

.descriptionObject



29
30
31
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 29

def self.description
  "A short description with <= 80 characters of what this action does"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 54

def self.is_supported?(platform)
  platform == :ios
end

.return_valueObject



46
47
48
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 46

def self.return_value
  "Provisioning profile name"
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/ciutils/actions/en_profile_name.rb', line 4

def self.run(params)
  file_path = params[:path]
  profile_name = ""

  unless file_path
    file_uuid = params[:uuid]
    file_path = "~/Library/MobileDevice/Provisioning Profiles/#{file_uuid}.mobileprovision"
    file_path = File.expand_path(file_path)
  end

  if File.exist?(file_path)
    profile_xml_data = Fastlane::Actions.sh "security cms -D -i '#{file_path}'", log: false
    profile_data = Plist.parse_xml(profile_xml_data)
    profile_name = profile_data['Name']
  else
    UI.user_error! "Could not find the specified profile at path '#{file_path}'"
  end

  profile_name
end