Chinaunix首页 | 论坛 | 博客
  • 博客访问: 270295
  • 博文数量: 48
  • 博客积分: 1062
  • 博客等级: 准尉
  • 技术积分: 531
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-23 09:47
文章分类
文章存档

2021年(1)

2019年(1)

2014年(4)

2011年(42)

分类: LINUX

2011-09-06 17:46:58

#!/usr/bin/env ruby
require 'vagrant'
require 'vagrant/cli'

env = Vagrant::Environment.new

begin
  # Begin logging early here
  env.logger.info("vagrant") { "`vagrant` invoked: #{ARGV.inspect}" }

  # Disable color if the proper argument was passed
  shell = ARGV.include?("--no-color") ? Thor::Shell::Basic.new : Thor::Base.shell.new

  # Set the UI early in case any errors are raised, and load
  # the config immediately, so we gather any new commands from
  # plugins
  env.ui = Vagrant::UI::Shell.new(env, shell)
  env.load!

  # Kick start the CLI
  Vagrant::CLI.start(ARGV, :env => env)
rescue Vagrant::Errors::VagrantError => e
  opts = { :prefix => false }
  env.ui.error e.message, opts if e.message
  env.ui.error e.backtrace.join("\n"), opts if ENV["VAGRANT_DEBUG"]
  exit e.status_code if e.respond_to?(:status_code)
  exit 999 # An error occurred with no status code defined
end
阅读(1687) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~