Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors on keys removal #238

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/pod/command/keys/rm.rb
Expand Up @@ -48,14 +48,19 @@ def run
raise Informative, 'Could not find a project to remove the key from.'
end

unless keyring.keys.count > 0
UI.puts "Project does not have keys to remove."
return
end

if @wipe_all
@key_name = '*'
end

matching_keys = matches(keyring.keys)
if matching_keys.count > 0
messages = matching_keys.map { |e| delete_key(e, keyring) }
raise Informative, messages.join("\n")
UI.puts messages.join("\n") unless config.silent?
else
raise Informative, "Could not find key that matched \"#{@key_name}\"."
end
Expand Down