Class: Fastlane::Actions::DeleteKeychainAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/delete_keychain.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, details, output, return_value, sh, step_text

Class Method Details

.authorsObject



25
26
27
# File 'lib/fastlane/actions/delete_keychain.rb', line 25

def self.authors
  ["gin0606"]
end

.available_optionsObject



16
17
18
19
20
21
22
23
# File 'lib/fastlane/actions/delete_keychain.rb', line 16

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :name,
                                 env_name: "KEYCHAIN_NAME",
                                 description: "Keychain name",
                                 optional: false)
  ]
end

.descriptionObject



12
13
14
# File 'lib/fastlane/actions/delete_keychain.rb', line 12

def self.description
  "Delete keychains and remove them from the search list"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/fastlane/actions/delete_keychain.rb', line 29

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



6
7
8
9
10
# File 'lib/fastlane/actions/delete_keychain.rb', line 6

def self.run(params)
  original = Actions.lane_context[Actions::SharedValues::ORIGINAL_DEFAULT_KEYCHAIN]
  Fastlane::Actions.sh("security default-keychain -s #{original}", log: false) unless original.nil?
  Fastlane::Actions.sh "security delete-keychain #{params[:name].shellescape}", log: false
end