summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-05-05 14:58:03 -0700
committerelijah <elijah@riseup.net>2015-05-05 14:58:03 -0700
commitab3184ff6dea960e347da299deaabeb23e2cf86e (patch)
treebbab53287df2355f80ef1f766aa7971ece80df6a
parent80f28c3862da72172a55d3e0218faad5cdd46b4b (diff)
add --force to 'leap cert csr'
-rw-r--r--lib/leap_cli/commands/ca.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/ca.rb b/lib/leap_cli/commands/ca.rb
index cfa18f5..d5c6240 100644
--- a/lib/leap_cli/commands/ca.rb
+++ b/lib/leap_cli/commands/ca.rb
@@ -87,7 +87,11 @@ module LeapCli; module Commands
assert_config! 'provider.ca.server_certificates.bit_size'
assert_config! 'provider.ca.server_certificates.digest'
domain = options[:domain] || provider.domain
- assert_files_missing! [:commercial_key, domain], [:commercial_csr, domain], :msg => 'If you really want to create a new key and CSR, remove these files first.'
+
+ unless global_options[:force]
+ assert_files_missing! [:commercial_key, domain], [:commercial_csr, domain],
+ :msg => 'If you really want to create a new key and CSR, remove these files first or run with --force.'
+ end
server_certificates = provider.ca.server_certificates