lib/nanoc/cli.rb in nanoc-4.8.10 vs lib/nanoc/cli.rb in nanoc-4.8.11
- old
+ new
@@ -18,10 +18,11 @@
require_relative 'cli/logger'
require_relative 'cli/command_runner'
require_relative 'cli/cleaning_stream'
require_relative 'cli/stream_cleaners'
require_relative 'cli/error_handler'
+require_relative 'cli/stack_trace_writer'
require_relative 'cli/commands/compile_listeners/abstract'
require_relative 'cli/commands/compile_listeners/debug_printer'
require_relative 'cli/commands/compile_listeners/diff_generator'
require_relative 'cli/commands/compile_listeners/file_action_printer'
@@ -111,10 +112,15 @@
add_command(help_cmd)
# Add other commands
cmd_filenames = Dir[__dir__ + '/cli/commands/*.rb']
cmd_filenames.each do |cmd_filename|
- next if File.basename(cmd_filename, '.rb') == 'nanoc'
+ basename = File.basename(cmd_filename, '.rb')
+
+ next if basename == 'nanoc'
+
+ next if basename == 'live' && !Nanoc::Feature.enabled?(Nanoc::Feature::LIVE_CMD)
+
cmd = load_command_at(cmd_filename)
add_command(cmd)
end
if defined?(Bundler)