middleman/middleman-core/bin/middleman

26 lines
771 B
Text
Raw Normal View History

#!/usr/bin/env ruby
2011-12-28 22:52:51 -08:00
# Add our lib/ directory to the path
libdir = File.expand_path(File.join(File.dirname(File.dirname(__FILE__)), "lib"))
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
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)
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-core/cli"
# Change directory to the root
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
2011-12-28 22:52:51 -08:00
# Start the CLI
Middleman::Cli::Base.start