Throw an exception when creating a File object for a path that isn't a file

This exception is getting thrown inside of `Project.scan` when it incorrectly parses a path with newlines in it. But the exception gets swallowed by ChildProcess.exec. At least it prevents a file from being created that we don't end up unsubscribing from. But `Project.scan` needs to be improved.
This commit is contained in:
Nathan Sobo
2012-07-19 09:20:45 -06:00
parent 31c3cb14f0
commit a61064eeeb

View File

@@ -9,6 +9,7 @@ class File
md5: null
constructor: (@path) ->
throw "Creating file with path that is not a file: #{@path}" unless fs.isFile(@path)
@updateMd5()
getPath: ->