bin/buildbox in buildbox-0.3.3 vs bin/buildbox in buildbox-0.3.4

- old
+ new

@@ -1,10 +1,20 @@ #!/usr/bin/env ruby # Disable stdout,stderr buffering STDERR.sync = STDOUT.sync = true -dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) +# Set the process name before we go to far in +$PROGRAM_NAME = 'buildbox' +# Add the buildbox lib directory to the load path +root_dir = File.expand_path(File.join(File.dirname(__FILE__), '..')) +lib_dir = File.join(root_dir, 'lib') +$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) + +# Setup bundler correctly +ENV['BUNDLE_GEMFILE'] ||= File.join(root_dir, "Gemfile") +require 'bundler/setup' + require 'buildbox' +Buildbox.logger.level = Logger::DEBUG if ENV['DEBUG'] == 'true' Buildbox::CLI.new(ARGV).parse