lib/keyring_liberator.rb in cocoapods-keys-2.0.3 vs lib/keyring_liberator.rb in cocoapods-keys-2.0.4

- old
+ new

@@ -45,11 +45,11 @@ end end def self.save_keyring(keyring) keys_dir.mkpath - if !ENV['TRAVIS'] && !ENV['TEAMCITY_VERSION'] && !ENV['CIRCLECI'] + if ci? prompt_if_already_existing(keyring) end yaml_path_for_path(keyring.path).open('w') { |f| f.write(YAML.dump(keyring.to_hash)) } end @@ -65,7 +65,14 @@ def self.get_keyring_at_path(path) Keyring.from_hash(YAML.load(path.read)) if path.file? end private_class_method :get_keyring_at_path + + def self.ci? + %w([JENKINS_HOME TRAVIS CIRCLECI CI TEAMCITY_VERSION GO_PIPELINE_NAME bamboo_buildKey GITLAB_CI XCS]).each do |current| + return true if ENV.key?(current) + end + false + end end end