Return a proper error when starting the watcher when there's nothing to compile.

Closes GH-119
This commit is contained in:
Chris Eppstein 2010-05-02 17:28:32 -07:00
parent 5f37fe48d6
commit 5dee634404
2 changed files with 6 additions and 2 deletions

View File

@ -29,12 +29,15 @@ module Compass
def perform
compiler = new_compiler_instance
check_for_sass_files!(compiler)
compiler.run
end
def check_for_sass_files!(compiler)
if compiler.sass_files.empty? && !dry_run?
message = "Nothing to compile. If you're trying to start a new project, you have left off the directory argument.\n"
message << "Run \"compass -h\" to get help."
raise Compass::Error, message
else
compiler.run
end
end

View File

@ -36,6 +36,7 @@ module Compass
exit 0
end
check_for_sass_files!(new_compiler_instance)
recompile
begin