Sha256: f83943e0780481d658ed1aa5be5ec070ea8de7ed7cbfebd548c6d597042da01e

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

module Dotman
  class Git
    def self.klone(git_location, alias_name = nil)
      unless git_location.nil?
        clone_repository(git_location, alias_name)
      end
    end

    def self.folder_name(git_location)
      folder_name = git_location.scan(/[^:]+[\/]?dotfile[s?]{1}/).first.gsub('/', '_')
    end

    def self.clone_repository(git_location, alias_name = nil)
      dotfile_location = "#{ENV['HOME']}/.dotman/#{folder_name(git_location)}"
      if (File.directory?(dotfile_location))
        STDOUT.puts("Dotfiles were already cloned")
      else
        system "git clone #{git_location} #{dotfile_location}"
        Dotman::DotfileCollection.new_configuration(folder_name(git_location), alias_name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dotman-0.0.2 lib/dotman/git.rb