def run(buildconf_info, interactive: nil, **options)
ws = Workspace.new(root_dir)
ws.config.interactive = interactive unless interactive.nil?
ws.setup
seed_config = options.delete(:seed_config)
switcher = Ops::MainConfigSwitcher.new(ws)
check_root_dir_empty =
ws.config.interactive? && switcher.check_root_dir_empty?
begin
switcher.bootstrap(buildconf_info,
check_root_dir_empty: check_root_dir_empty,
**options)
if seed_config
FileUtils.cp seed_config, File.join(ws.config_dir, "config.yml")
end
STDOUT.puts <<-EOTEXT
#{Autoproj.color('autoproj bootstrap successfully finished', :green, :bold)}
#{Autoproj.color('To further use autoproj and the installed software', :bold)}, you
must add the following line at the bottom of your .bashrc:
source #{root_dir}/#{Autoproj::ENV_FILENAME}
WARNING: autoproj will not work until your restart all
your consoles, or run the following in them:
$ source #{root_dir}/#{Autoproj::ENV_FILENAME}
#{Autoproj.color('To import and build the packages', :bold)}, you can now run
aup
amake
The resulting software is installed in
#{ws.prefix_dir}
EOTEXT
rescue RuntimeError
STDERR.puts <<-EOTEXT
#{Autoproj.color('autoproj bootstrap failed', :red, :bold)}
To retry, first source the #{Autoproj::ENV_FILENAME} script with
source #{root_dir}/#{Autoproj::ENV_FILENAME}
and then re-run autoproj bootstrap
autoproj bootstrap '#{ARGV.join("'")}'
EOTEXT
raise
end
end