2011-07-26 21:06:24 -07:00
|
|
|
#!/usr/bin/env ruby
|
2011-07-26 23:19:43 -07:00
|
|
|
|
2011-12-28 22:52:51 -08:00
|
|
|
# Add our lib/ directory to the path
|
2011-12-24 11:30:41 -08:00
|
|
|
libdir = File.expand_path(File.join(File.dirname(File.dirname(__FILE__)), "lib"))
|
|
|
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
2011-08-03 17:10:16 -07:00
|
|
|
|
2012-05-24 11:03:58 -07:00
|
|
|
moredir = File.expand_path(File.join(File.dirname(File.dirname(libdir)), "middleman-more", "lib", "middleman-more"))
|
|
|
|
$LOAD_PATH.unshift(moredir) unless $LOAD_PATH.include?(moredir)
|
2011-08-03 17:10:16 -07:00
|
|
|
|
2012-07-18 22:10:02 -07:00
|
|
|
require 'middleman-core/profiling'
|
|
|
|
if ARGV.include? '--profile'
|
|
|
|
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
|
|
|
|
end
|
|
|
|
Middleman::Profiling.start
|
|
|
|
|
2012-07-16 17:24:13 -07:00
|
|
|
require "middleman-core/load_paths"
|
|
|
|
Middleman.setup_load_paths
|
2012-05-24 11:03:58 -07:00
|
|
|
|
2012-05-26 14:15:36 -07:00
|
|
|
require "middleman-core/cli"
|
|
|
|
|
2012-07-16 17:24:13 -07:00
|
|
|
# Change directory to the root
|
|
|
|
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
|
2011-12-28 22:52:51 -08:00
|
|
|
|
2012-05-24 11:03:58 -07:00
|
|
|
# Start the CLI
|
2012-07-18 22:10:02 -07:00
|
|
|
Middleman::Cli::Base.start
|