diff --git a/lib/middleman-blog/commands/article.rb b/lib/middleman-blog/commands/article.rb index 59db38a..ebb4c6c 100644 --- a/lib/middleman-blog/commands/article.rb +++ b/lib/middleman-blog/commands/article.rb @@ -64,7 +64,13 @@ def self.source_root aliases: "-t", desc: "A list of comma-separated tags for the post" + class_option "environment", + desc: "The environment to generate article for", + default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development', + type: :string + def article + env = options[:environment].to_s.to_sym @content = options[:content] || "" @date = options[ :date ] ? ::Time.zone.parse( options[ :date ] ) : Time.zone.now @@ -75,6 +81,7 @@ def article app = ::Middleman::Application.new do config[ :mode ] = :config + config[ :environment ] = env config[ :disable_sitemap ] = true config[ :watcher_disable ] = true config[ :exit_before_ready ] = true