middleman/middleman-cli/bin/middleman
Thomas Reynolds f16510d034 Update CLI
2015-01-04 14:23:35 -06:00

24 lines
536 B
Ruby
Executable file

#!/usr/bin/env ruby
require 'middleman-core/profiling'
if ARGV.include? '--profile'
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
end
Middleman::Profiling.start
require "middleman-core/load_paths"
Middleman.setup_load_paths
require "middleman-cli"
# Change directory to the root
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
# Default command is server
if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
ARGV.unshift('server')
end
# Start the CLI
Middleman::Cli::Base.start(ARGV)