lib/hanami/cli_sub_commands/generate.rb in hanami-0.8.0 vs lib/hanami/cli_sub_commands/generate.rb in hanami-0.9.0
- old
+ new
@@ -121,8 +121,24 @@
else
require 'hanami/commands/generate/app'
Hanami::Commands::Generate::App.new(options, application_name).start
end
end
+
+ desc 'secret APPLICATION_NAME', 'Print a fresh secret token for production'
+ long_desc <<-EOS
+ `hanami generate secret` prints a new secret for a given app
+
+ > $ hanami generate secret web
+
+ EOS
+ def secret(application_name = nil)
+ if options[:help]
+ invoke :help, ['secret']
+ else
+ require 'hanami/commands/generate/secret_token'
+ Hanami::Commands::Generate::SecretToken.new(application_name).start
+ end
+ end
end
end
end