Sha256: 9b1e55804d83f035d5b5dcf6e7a5eac44c4643b8f18bf32f24033c35018e0518

Contents?: true

Size: 1.41 KB

Versions: 54

Compression:

Stored size: 1.41 KB

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?
                    default_cache_dirs = Autobuild::Importer.default_cache_dirs
                    if !default_cache_dirs || default_cache_dirs.empty?
                        raise ArgumentError, "no cache directory defined with e.g. the AUTOBUILD_CACHE_DIR environment variable, expected one cache directory as argument"
                    end
                    Autoproj.warn "using cache directory #{default_cache_dirs.first} from the autoproj configuration"
                    argv << default_cache_dirs.first
                elsif argv.size > 1
                    raise ArgumentError, "expected only 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

54 entries across 54 versions & 1 rubygems

Version Path
autoproj-2.3.1 lib/autoproj/cli/cache.rb
autoproj-2.3.0 lib/autoproj/cli/cache.rb
autoproj-2.2.2 lib/autoproj/cli/cache.rb
autoproj-2.2.1 lib/autoproj/cli/cache.rb
autoproj-2.2.0 lib/autoproj/cli/cache.rb
autoproj-2.1.2 lib/autoproj/cli/cache.rb
autoproj-2.1.1 lib/autoproj/cli/cache.rb
autoproj-2.1.0 lib/autoproj/cli/cache.rb
autoproj-2.1.0.rc1 lib/autoproj/cli/cache.rb
autoproj-2.0.3 lib/autoproj/cli/cache.rb
autoproj-2.0.2 lib/autoproj/cli/cache.rb
autoproj-2.0.1 lib/autoproj/cli/cache.rb
autoproj-2.0.0 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc42 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc41 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc40 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc39 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc38 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc37 lib/autoproj/cli/cache.rb
autoproj-2.0.0.rc36 lib/autoproj/cli/cache.rb