Permalink
Browse files

fixed bug where it would overwrite file

  • Loading branch information...
1 parent dea750a commit 09762b1d186c7145d8c4bbfbd5c4a8ed49fe329c @marksands committed Jan 9, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/markview.rb
View
@@ -12,9 +12,9 @@ class Markview < Sinatra::Base
configure do
@@markup = ARGV[0] ||= Dir.glob("README*")[0]
- if !@@markup.nil?
+ if !@@markup.nil? && !File.file?(@@markup)
File.new(@@markup, "w+")
- else
+ elsif !File.file?(@@markup)
raise LoadError, "Failed to find suitable file in current working directory!"; exit!
end
end

0 comments on commit 09762b1

Please sign in to comment.