Created
December 21, 2009 21:18
-
-
Save samhendley/261246 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files = Dir['./db/migrate/*.rb'].sort | |
now = Time.now.utc | |
time = Time.utc(now.year, now.month, now.day) | |
files.each do |full_file| | |
file = File.basename(full_file) | |
parts = file.split('_') | |
raise "probably illegal file name #{file}" if parts.size < 2 | |
if parts[0].size < 7 | |
cmd = "svn move #{full_file} #{full_file.gsub(parts[0], time.to_i.to_s)}" | |
puts cmd | |
system cmd | |
time += 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment