Skip to content
Browse files

Check to see if the file exists first!

  • Loading branch information...
1 parent b578b7d commit 89aaccfe7d4e66b90bacdcd915943353dabcc1ec @danhigham committed May 6, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/rack/coffee.rb
View
5 lib/rack/coffee.rb
@@ -82,11 +82,12 @@ def call(env)
define_command :bare => bare, :output_path => output_path
if @cache
- F.delete F.join(output_path, path.match(/[^\/]+$/)[0])
+ js_file = F.join(output_path, path.match(/[^\/]+$/)[0])
+ F.delete js_file if F.file? js_file
brew(coffee)
- out = read_file F.join(output_path, path.match(/[^\/]+$/)[0])
+ out = read_file js_file
[200, headers, out]
else

0 comments on commit 89aaccf

Please sign in to comment.
Something went wrong with that request. Please try again.