Sha256: 068ec79bcf602bd335bd77a5bd81ff029f9f54dd26d7e02cb33e9afb7ffa03c8

Contents?: true

Size: 1.22 KB

Versions: 9

Compression:

Stored size: 1.22 KB

Contents

require 'autoproj/cli/inspection_tool'

module Autoproj
    module CLI
        class Clean < InspectionTool
            def validate_options(packages, options)
                packages, options = super
                if packages.empty? && !options[:all]
                    opt = BuildOption.new("", "boolean", {:doc => "this is going to clean all packages. Is that really what you want ?"}, nil)
                    if !opt.ask(false)
                        raise Interrupt
                    end
                end
                return packages, options
            end

            def run(selection, options = Hash.new)
                initialize_and_load
                packages, _ = normalize_command_line_package_selection(selection)
                source_packages, * = resolve_selection(
                    selection,
                    recursive: false)
                if packages.empty?
                    raise ArgumentError, "no packages or OS packages match #{selection.join(" ")}"
                end

                source_packages.each do |pkg_name|
                    ws.manifest.find_autobuild_package(pkg_name).
                        prepare_for_rebuild
                end
            end
        end
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
autoproj-2.0.3 lib/autoproj/cli/clean.rb
autoproj-2.0.2 lib/autoproj/cli/clean.rb
autoproj-2.0.1 lib/autoproj/cli/clean.rb
autoproj-2.0.0 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc42 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc41 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc40 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc39 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc38 lib/autoproj/cli/clean.rb