Skip to content

Instantly share code, notes, and snippets.

@jordelver
Last active December 21, 2015 06:59
Show Gist options
  • Save jordelver/6267929 to your computer and use it in GitHub Desktop.
Save jordelver/6267929 to your computer and use it in GitHub Desktop.
require 'pathname'
require 'fileutils'
Pathname.glob("content/articles/**/index.txt").entries.each do |path|
new_filename = path.to_s.split('/')[2..5].join('-')
new_filename = "#{new_filename}.html.markdown"
FileUtils.cp(path, new_filename)
end
@jordelver
Copy link
Author

OMG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment