From 597605c80d0c8f4cebdd6050afef097b28f7ced9 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 4 Sep 2011 14:08:01 -0400 Subject: Added magical script --- pull.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 pull.rb 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') -- cgit 1.4.1