Sha256: 299afcaade73225e1f940e7a2848f218babe2cd8e026aae51daadf74933f40f6

Contents?: true

Size: 1009 Bytes

Versions: 6

Compression:

Stored size: 1009 Bytes

Contents

require 'autoproj/cli/inspection_tool'
require 'autoproj/ops/cache'

module Autoproj
    module CLI
        class Cache < InspectionTool
            def validate_options(argv, options = Hash.new)
                argv, options = super

                if argv.empty?
                    raise ArgumentError, "expected one cache directory as argument"
                elsif argv.size > 1
                    raise ArgumentError, "expected one cache directory as argument"
                end

                return File.expand_path(argv.first, ws.root_dir), options
            end

            def run(cache_dir, options = Hash.new)
                options = Kernel.validate_options options,
                    keep_going: false,
                    checkout_only: false

                initialize_and_load
                finalize_setup

                cache_op = Autoproj::Ops::Cache.new(cache_dir, ws.manifest)
                cache_op.create_or_update(options)
            end
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
autoproj-2.0.0.b7 lib/autoproj/cli/cache.rb
autoproj-2.0.0.b6 lib/autoproj/cli/cache.rb
autoproj-2.0.0.b5 lib/autoproj/cli/cache.rb
autoproj-2.0.0.b4 lib/autoproj/cli/cache.rb
autoproj-2.0.0.b3 lib/autoproj/cli/cache.rb
autoproj-2.0.0.b2 lib/autoproj/cli/cache.rb