Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 24 lines (19 sloc) 0.684 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# -*- ruby -*-

require 'rakelib/git'

namespace :winpthreads do
  desc "Synchronize vendor/winpthreads with current clone"
  task :sync do
    unless src_dir = ENV['DIR']
      raise "Use DIR= to specify a clone of winpthreads"
    end
    dest_dir = "vendor/winpthreads"

    unless is_git_project src_dir, "winpthreads.git"
      raise "#{src_dir} is not a winpthreads clone. Clone from 'git://github.com/brixen/winpthreads.git'"
    end

    rm_rf dest_dir
    rsync "#{src_dir}/*", dest_dir

    version = Dir.chdir(src_dir) { `git log --pretty=oneline -1`[0..7] }
    sh "git add -f #{dest_dir}"
    sh "git commit -m 'Updated winpthreads to #{version}.' #{dest_dir}"
  end
end
Something went wrong with that request. Please try again.