Sha256: b3d3ebccbd9252f99a66b45061b26ff3597973b55ec94c5e22a5e6b536fb042a
Contents?: true
Size: 832 Bytes
Versions: 10
Compression:
Stored size: 832 Bytes
Contents
# encoding: utf-8 module LocalPac module Actions class CreateRepository private attr_reader :vcs_engine, :path, :options public def initialize(path, options = {}, vcs_engine = LocalPac::Git) @path = path @options = options @vcs_engine = vcs_engine end def run if need_to_run? || options[:force] == true LocalPac.ui_logger.warn "Creating repository \"#{path}\"." if options[:bare] == true vcs_engine.init(path, true) else vcs_engine.init(path) end else LocalPac.ui_logger.warn "Repository \"#{path}\" already exists. Do not create it again!." end end private def need_to_run? !File.exists?(path) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems