Skip to content

Instantly share code, notes, and snippets.

@samhendley
Created December 21, 2009 21:18
Show Gist options
  • Save samhendley/261246 to your computer and use it in GitHub Desktop.
Save samhendley/261246 to your computer and use it in GitHub Desktop.
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