Last active
August 29, 2015 14:06
-
-
Save jrpz/29012b4e6f22a560d35a to your computer and use it in GitHub Desktop.
For when I forget to export pngs without extensions
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
# Step thru directory | |
# Find files without extension | |
# Rename file to include .png extension | |
dir = Dir.getwd | |
Dir.foreach(dir) do |f| | |
ext = File.extname(f) | |
if ext == '' && File.file?(f) | |
File.rename(f, "#{f}.png") | |
end | |
end | |
puts "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment