2011-07-27 00:06:24 -04:00
|
|
|
#!/usr/bin/env ruby
|
2011-07-27 02:19:43 -04:00
|
|
|
|
2012-07-19 01:10:02 -04:00
|
|
|
require 'middleman-core/profiling'
|
|
|
|
if ARGV.include? '--profile'
|
|
|
|
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
|
|
|
|
end
|
2016-01-22 18:57:07 -05:00
|
|
|
# Middleman::Profiling.start
|
2012-07-19 01:10:02 -04:00
|
|
|
|
2012-07-16 20:24:13 -04:00
|
|
|
require "middleman-core/load_paths"
|
|
|
|
Middleman.setup_load_paths
|
2012-05-24 14:03:58 -04:00
|
|
|
|
2014-01-02 19:34:08 -05:00
|
|
|
require "middleman-cli"
|
2012-05-26 17:15:36 -04:00
|
|
|
|
2012-07-16 20:24:13 -04:00
|
|
|
# Change directory to the root
|
|
|
|
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
|
2011-12-29 01:52:51 -05:00
|
|
|
|
2015-01-04 15:23:35 -05:00
|
|
|
# Default command is server
|
|
|
|
if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
|
|
|
|
ARGV.unshift('server')
|
|
|
|
end
|
|
|
|
|
2012-05-24 14:03:58 -04:00
|
|
|
# Start the CLI
|
2015-01-04 15:23:35 -05:00
|
|
|
Middleman::Cli::Base.start(ARGV)
|