Class: Fastlane::Actions::DeleteKeychainAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorsObject



39
40
41
# File 'lib/fastlane/actions/delete_keychain.rb', line 39

def self.authors
  ["gin0606"]
end

.available_optionsObject



20
21
22
23
24
25
26
27
# File 'lib/fastlane/actions/delete_keychain.rb', line 20

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

.categoryObject



35
36
37
# File 'lib/fastlane/actions/delete_keychain.rb', line 35

def self.category
  :misc
end

.descriptionObject



16
17
18
# File 'lib/fastlane/actions/delete_keychain.rb', line 16

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

.detailsObject



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

def self.details
  "Keychains can be deleted after being creating with `create_keychain`"
end

.example_codeObject



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

def self.example_code
  [
    'delete_keychain(name: "KeychainName")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/fastlane/actions/delete_keychain.rb', line 43

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