Sha256: c1a58cadb5115a79b918473d93ccf8d2544250a6fe90df032259628cab922b18

Contents?: true

Size: 967 Bytes

Versions: 7

Compression:

Stored size: 967 Bytes

Contents

require 'autoproj'
require 'autoproj/cli/base'
require 'autoproj/ops/main_config_switcher'
require 'autoproj/ops/configuration'

module Autoproj
    module CLI
        class SwitchConfig < Base
            def run(args, options = Hash.new)
                if Dir.pwd.start_with?(ws.remotes_dir) || Dir.pwd.start_with?(ws.config_dir)
                    raise ConfigError, "you cannot run autoproj switch-config from autoproj's configuration directory or one of its subdirectories"
                end

                ws.load_config

                # We must switch to the root dir first, as it is required by the
                # configuration switch code. This is acceptable as long as we
                # quit just after the switch
                switcher = Ops::MainConfigSwitcher.new(ws)
                if switcher.switch_config(*args)
                    CLI::Main.start(['update', '--config'])
                end
            end
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
autoproj-2.0.0.rc5 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.rc4 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.rc3 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.rc2 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.rc1 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.b7 lib/autoproj/cli/switch_config.rb
autoproj-2.0.0.b6 lib/autoproj/cli/switch_config.rb