lib/rake/jitaitask.rb in jitai-0.2.3 vs lib/rake/jitaitask.rb in jitai-0.2.4
- old
+ new
@@ -38,20 +38,18 @@
conversion_type = (File.extname(font_file).downcase.eql? ".ttf")? ".eot" : ".ttf"
other_basename = font_file.split(".")[0] + conversion_type
other_file = "./#{@cwd}#{other_basename}"
file = "./#{@cwd}#{font_file}"
- puts "other file: #{other_file}"
- puts "file: #{file}"
-
# TODO edit ttf2eot so that it's actually installed in the system
if !File.exists?(other_file)
+ puts "===== #{conversion_type.upcase} format not found. Attempting to convert... ====="
%x{cd lib/ttf2eot && ./ttf2eot < #{'../../' + @cwd + font_file} > #{'../../' + @cwd + font_file.split(".")[0] + conversion_type}}
end
- # CONVENTIONS LOL
- %x{mv #{other_file} #{other_file.downcase}}
- %x{mv #{file} #{file.downcase}}
+ # Rename files, account for conventions.
+ %x{mv #{other_file} #{other_file.downcase}} if !(File.exists?(other_file.downcase))
+ %x{mv #{file} #{file.downcase}} if !(File.exists?(file.downcase))
font = Jitai::Font.new(font_file)
font.to_css
end
end