Sha256: 702fb80bb63330ec5c288a8c13dfa4fc0e9318f1a2be96f6ba5b333820c11665

Contents?: true

Size: 613 Bytes

Versions: 23

Compression:

Stored size: 613 Bytes

Contents

require 'fileutils'

module PkgForge
  ##
  # Add source methods to Forge
  class Forge
    private

    Contract None => nil
    def prepare_source!
      dest = tmpdir(:build)
      dest_git = File.join(dest, '.git')
      dest_git_config = File.join(dest_git, 'config')
      run_local 'git submodule update --init'
      FileUtils.cp_r 'upstream/.', dest
      FileUtils.rm_r dest_git
      FileUtils.cp_r '.git/modules/upstream', dest_git
      new_config = File.readlines(dest_git_config).grep_v(/worktree =/).join
      File.open(dest_git_config, 'w') { |fh| fh << new_config }
      nil
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pkgforge-0.5.4 lib/pkgforge/components/source.rb
pkgforge-0.5.3 lib/pkgforge/components/source.rb
pkgforge-0.5.2 lib/pkgforge/components/source.rb
pkgforge-0.5.1 lib/pkgforge/components/source.rb
pkgforge-0.5.0 lib/pkgforge/components/source.rb
pkgforge-0.4.16 lib/pkgforge/components/source.rb
pkgforge-0.4.15 lib/pkgforge/components/source.rb
pkgforge-0.4.14 lib/pkgforge/components/source.rb
pkgforge-0.4.13 lib/pkgforge/components/source.rb
pkgforge-0.4.12 lib/pkgforge/components/source.rb
pkgforge-0.4.11 lib/pkgforge/components/source.rb
pkgforge-0.4.10 lib/pkgforge/components/source.rb
pkgforge-0.4.9 lib/pkgforge/components/source.rb
pkgforge-0.4.8 lib/pkgforge/components/source.rb
pkgforge-0.4.7 lib/pkgforge/components/source.rb
pkgforge-0.4.6 lib/pkgforge/components/source.rb
pkgforge-0.4.5 lib/pkgforge/components/source.rb
pkgforge-0.4.4 lib/pkgforge/components/source.rb
pkgforge-0.4.3 lib/pkgforge/components/source.rb
pkgforge-0.4.2 lib/pkgforge/components/source.rb