summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2011-09-04 14:08:01 -0400
committerJune McEnroe <june@causal.agency>2011-09-04 14:08:01 -0400
commit5de1724c6f28cee8617ef1fb5b15d0e270a72c00 (patch)
tree257b19fea38b202cde7df8b6f56a4f879c3d9d2d
downloadsrc-5de1724c6f28cee8617ef1fb5b15d0e270a72c00.tar.gz
src-5de1724c6f28cee8617ef1fb5b15d0e270a72c00.zip
Added magical script
-rwxr-xr-xpull.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/pull.rb b/pull.rb
new file mode 100755
index 00000000..0aaffc5a
--- /dev/null
+++ b/pull.rb
@@ -0,0 +1,27 @@
+#!/usr/bin/env ruby
+
+require 'fileutils'
+
+dotfiles = {}
+
+dirs = ['.']
+dirs.each do |dir|
+  Dir.foreach(dir) do |file|
+    next if file[0] == '.'
+    file = File.join(dir, file)
+    if File.directory? file
+      dirs << file
+      next
+    end
+    dotfiles[file] = file.sub('.', '~').sub('_', '.') if %r{/_} =~ file
+  end
+end
+
+dotfiles.each do |a, b|
+  a, b = File.expand_path(a), File.expand_path(b)
+  FileUtils.cp(b, a)
+  puts "#{b} -> #{a}"
+end
+
+system('git add .')
+exec('git commit -a')