Sha256: 85b03135f64ba69fbfa8086941620d85357c4309dcac314e82b707d70933b6f0

Contents?: true

Size: 407 Bytes

Versions: 1

Compression:

Stored size: 407 Bytes

Contents

module Vendorise
  class Arborist
    attr_reader :path, :url, :branch

    def initialize(path, url, branch)
      @path = path
      @url = url
      @branch = branch
    end

    def subtree_already_exists?
      Dir.exist?(path)
    end

    def subtree_command
      cmd = subtree_already_exists? ? "pull" : "add"
      "git subtree #{cmd} --prefix #{path} #{url} #{branch} --squash"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vendorise-0.3.0 lib/vendorise/arborist.rb