Sha256: 47b5c7ad13dba2940697046187e79b085e37a96a9de7c96112fde95b96c65b5e

Contents?: true

Size: 598 Bytes

Versions: 1

Compression:

Stored size: 598 Bytes

Contents

class TerraspaceBundler::Mod
  class Export
    include TmpPaths

    def initialize(locked_mod)
      @locked_mod = locked_mod
    end

    def run
      stage_path = stage_path(@locked_mod.full_repo)
      stage_path = "#{stage_path}/#{@locked_mod.path}" if @locked_mod.path
      export_path = export_path(@locked_mod.name)
      FileUtils.rm_rf(export_path)
      FileUtils.mkdir_p(File.dirname(export_path))
      FileUtils.cp_r(stage_path, export_path)
      FileUtils.rm_rf("#{export_path}/.git")
    end

    def export_path(repo)
      "#{TB.config.export_path}/#{repo}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terraspace-bundler-0.1.0 lib/terraspace_bundler/mod/export.rb