Sha256: ab6ff2b9fd9fd51712a11d9fca928b05cf36ef1fd2a2961e28cce1eb5b510ba4

Contents?: true

Size: 652 Bytes

Versions: 6

Compression:

Stored size: 652 Bytes

Contents

module Rebuild::CLI
  class RbldSaveCommand < Command
    private

    def default_file(env)
      "#{env.name}-#{env.tag}.rbld"
    end

    public

    def initialize
      @usage = "[OPTIONS] [ENVIRONMENT] [FILE]"
      @description = "Save local environment to file"
    end

    def run(parameters)
      env, file = parameters
      env = Environment.new( env )
      file = default_file( env ) if !file or file.empty?
      rbld_log.info("Going to save #{env} to #{file}")

      warn_if_modified( env, 'saving' )
      engine_api.save(env, file)

      rbld_print.progress "Successfully saved environment #{env} to #{file}\n"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rbld-1.3.8 cli/lib/commands/rbld_save.rb
rbld-1.3.7 cli/lib/commands/rbld_save.rb
rbld-1.3.6 cli/lib/commands/rbld_save.rb
rbld-1.3.5 cli/lib/commands/rbld_save.rb
rbld-1.3.4 cli/lib/commands/rbld_save.rb
rbld-1.3.3 cli/lib/commands/rbld_save.rb