Sha256: d773f66eccf4334dd936ff2b4ec4769b05652b193783985dbed56e836f30d223

Contents?: true

Size: 436 Bytes

Versions: 10

Compression:

Stored size: 436 Bytes

Contents

name = next_arg("Please specify the key name")
if name !~ /[a-zA-Z0-9]+/
  $stderr.puts "Not a valid key name (letters and numbers only)"
  exit 1
end

dirname = File.join(find_account_dir(@username), "keys")
FileUtils.mkdir_p(dirname)

filename = File.join(dirname, name)
if !File.exist?(filename)
  $stderr.puts "Key not found"
  exit 1
end

unless FileUtils.rm(filename)
  $stderr.puts "Unable to delete key"
  exit 1
end

sync_keys

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hubbard-0.0.9 commands/remove-key.rb
hubbard-0.0.8 commands/remove-key.rb
hubbard-0.0.7 commands/remove-key.rb
hubbard-0.0.6 commands/remove-key.rb
hubbard-0.0.5 commands/remove-key.rb
hubbard-0.0.4 commands/remove-key.rb
hubbard-0.0.3 commands/remove-key.rb
hubbard-0.0.2 commands/remove-key.rb
hubbard-0.0.1 commands/remove-key.rb
hubbard-0.0.0 commands/remove-key.rb