Skip to content

Instantly share code, notes, and snippets.

@entropie
Created April 30, 2009 10:39
Show Gist options
  • Save entropie/104397 to your computer and use it in GitHub Desktop.
Save entropie/104397 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#
#
# Author: Michael 'entropie' Trommer <[email protected]>
#
require "pathname"
require "fileutils"
DIR = Pathname.new(File.expand_path("~/Source"))
EX = DIR.join("Extern/fast-export").join("hg-fast-export.sh")
skip = ["Extern", "entropie.github.com", "gaubln", "oms.git", "oooms", "GIT"]
FileUtils.mkdir_p(TDIR=(DIR.join("GIT")))
DIR.entries.select{|e| e.to_s[0..0] != "."}.each do |content|
next if skip.include?(content.to_s)
FileUtils.mkdir_p(TDIR.join(nname = content.to_s + ".git"))
system "cd #{DIR.join("GIT", nname)} && git init"
system "cd #{DIR.join("GIT", nname)} && sh #{EX} -r #{DIR.join(content)}"
sleep 5
end
=begin
Local Variables:
mode:ruby
fill-column:70
indent-tabs-mode:nil
ruby-indent-level:2
End:
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment