diff options
author | June McEnroe <june@causal.agency> | 2011-09-04 23:08:38 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2011-09-04 23:08:38 -0400 |
commit | 505a8374ac06373781f8183d442efb0959f26fa4 (patch) | |
tree | 9a834124d12068075f865abe0a41b2a4a693f6fc /update.rb | |
parent | Added xinitrc (diff) | |
download | src-505a8374ac06373781f8183d442efb0959f26fa4.tar.gz src-505a8374ac06373781f8183d442efb0959f26fa4.zip |
Renamed pull to update
Diffstat (limited to 'update.rb')
-rwxr-xr-x | update.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/update.rb b/update.rb new file mode 100755 index 00000000..538e0bd2 --- /dev/null +++ b/update.rb @@ -0,0 +1,28 @@ +#!/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 .') +system('git commit') +system('git push') |