Sha256: caa45f2d78276e806f1d7a442868780fafdb00cddb9c88b16e8707994f17daf0

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require 'build-tool/application'
require 'build-tool/commands'

module BuildTool; module Commands;

    class CtagsError < BuildTool::Error; end
    #
    # BuildCommand
    #
    class Fetch < ModuleBasedCommand

        include MJ::Tools::SubProcess

        name        "fetch"
        description "fetch remote changes (if applicable)"

        def applicable?
            BuildTool::Application.instance.name != "build-tool"
        end

        def is_module_ready?( mod )
            isready = true
            isready &= mod.prepare_for_vcs_access
            if !mod.vcs.fetching_supported?
                logger.warn "#{mod.name}: fetching not support by #{mod.vcs.name} -> implicit rebase."
            end
            return isready
        end

        def do_execute_module( mod )

            if mod.checkedout?
                mod.fetch( @log_directory )
            else
                mod.clone( @log_directory )
            end

        end

        def do_execute( args )
            rc = super(args)
            MJ::Tools::SSH::cleanup()
            return rc
        end

    end # class Build

end; end # module BuildTool::Commands


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
build-tool-0.1.4 lib/build-tool/commands/fetch.rb
build-tool-0.1.3 lib/build-tool/commands/fetch.rb
build-tool-0.1.2 lib/build-tool/commands/fetch.rb
build-tool-0.1.0 lib/build-tool/commands/fetch.rb
build-tool-0.1.1 lib/build-tool/commands/fetch.rb