Skip to content

Instantly share code, notes, and snippets.

@indirect
Created August 23, 2008 17:13
Show Gist options
  • Save indirect/6929 to your computer and use it in GitHub Desktop.
Save indirect/6929 to your computer and use it in GitHub Desktop.
def season(dn)
Dir.glob(dn+"/*").sort.each do |fn|
if fn=~/#{dn}\/.*?(\d+)x\d+.*?/
sdir = dn+"/#{dn} Season #{$1}"
FileUtils.mkdir_p(sdir)
FileUtils.mv(fn, sdir+"/")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment