Sha256: 36d5cf397482ea68868c93b734030cda47956b707685a3fbdfa08c39751d7dd9

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require 'uri'

module Astrovan
  module Update
    def update(options = {})
      shared_repository = self.shared_repository
      repository = self.repository
      release_path = self.release_path

      # TODO: do we need branch support, submodule config, etc?
      exec <<-END, options
        if [ -d '#{shared_repository}' ]
        then
          cd #{shared_repository} &&
          git fetch #{repository}
        else
          git clone --bare #{repository} #{shared_repository}
        fi &&
        git clone #{shared_repository} #{release_path}
      END

      yield if block_given?
    rescue => e
      # TODO: rollback
      # rollback
      raise
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sbfaulkner-astrovan-0.5.0 lib/astrovan/update.rb