Permalink
Browse files

Catch exception in builder when no ls is available - makes it possibl…

…e to run rake tasks on Windows boxes
  • Loading branch information...
Christian Johansen
Christian Johansen committed Nov 17, 2009
1 parent 20dc21b commit 3df99786b508304c3db607f26b0ee5af0eeafc1a
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/vbuilder/validator.rb
View
@@ -103,9 +103,13 @@ def self.join(output, names = nil)
# If the standard validators are required, and the standard.js file is the
# most recent one, abort.
- if names.nil?
- most_recent = `ls -ltc #{dirname}`.split("\n")[1].split(/([^\s]*)$/)[1]
- return if most_recent == File.basename(output)
+ begin
+ if names.nil?
+ most_recent = `ls -ltc #{dirname}`.split("\n")[1].split(/([^\s]*)$/)[1]
+ return if most_recent == File.basename(output)
+ end
+ rescue Errno::ENOENT => err
+ # We're probably on Windows, no biggie, just build it over
end
names ||= Validator.find_all(dirname, true).collect { |v| v.filename }

0 comments on commit 3df9978

Please sign in to comment.