Sha256: de7e4e16cb26ae933dc69efbd2a7e53a97c93d51463a20181fc44723751abbb9

Contents?: true

Size: 657 Bytes

Versions: 8

Compression:

Stored size: 657 Bytes

Contents

module Rebuild::CLI
  class RbldSaveCommand < Command
    private

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

    public

    def initialize
      @usage = "save [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

8 entries across 8 versions & 1 rubygems

Version Path
rbld-1.3.2 cli/lib/commands/rbld_save.rb
rbld-1.3.1 cli/lib/commands/rbld_save.rb
rbld-1.3.0 cli/lib/commands/rbld_save.rb
rbld-1.2.0 cli/lib/commands/rbld_save.rb
rbld-1.1.0 cli/lib/commands/rbld_save.rb
rbld-1.0.2 cli/lib/commands/rbld_save.rb
rbld-1.0.1 cli/lib/commands/rbld_save.rb
rbld-1.0.0 cli/lib/commands/rbld_save.rb