Sha256: 2aa5a98c11316ce1cbf584cf0d5f282d97c9189077ef7e570c25d71ce3c3f08d

Contents?: true

Size: 981 Bytes

Versions: 5

Compression:

Stored size: 981 Bytes

Contents

module Rebuild::CLI
  class RbldRunCommand < Command

    include RunOptions

    def initialize
      @usage = [
                { :syntax => "run [OPTIONS] [ENVIRONMENT[:TAG]]",
                  :description => "Interactive mode: opens shell in the " \
                                  "specified enviroment" },
                { :syntax => "run [OPTIONS] [ENVIRONMENT[:TAG]] -- COMMANDS",
                  :description => "Scripting mode: runs COMMANDS in the " \
                                  "specified environment" }
               ]
      @description = "Run command in a local environment"
      @options = opts_text
    end

    def run(parameters)
      runopts, parameters = parse_opts( parameters )
      env = Environment.new( parameters.shift )
      cmd = get_cmdline_tail( parameters )
      rbld_log.info("Going to run \"#{cmd}\" in \"#{env}\"")

      warn_if_modified( env, 'running' )
      @errno = engine_api.run( env, cmd, runopts )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbld-1.3.2 cli/lib/commands/rbld_run.rb
rbld-1.3.1 cli/lib/commands/rbld_run.rb
rbld-1.3.0 cli/lib/commands/rbld_run.rb
rbld-1.2.0 cli/lib/commands/rbld_run.rb
rbld-1.1.0 cli/lib/commands/rbld_run.rb