tomlokhorst / CoffeeSharp

CoffeeScript compilation for Windows
http://tomlokhorst.github.io/CoffeeSharp
Other
57 stars 8 forks source link

Watching throws The directory name is invalid. #1

Closed lanwin closed 13 years ago

lanwin commented 13 years ago

Coffee.exe -w -o test -c test.coffee

produces:

Unhandled Exception: System.ArgumentException: The directory name is invalid. at System.IO.FileSystemWatcher..ctor(String path, String filter) at System.IO.FileSystemWatcher..ctor(String path) at Program.watch[a](String dir, FSharpList1 fns, Boolean bare, Boolean print, FSharpOption1 outputDir) at Program.main@139-3.Invoke(String src) at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc2 mapping, FSharpList1 x) at Program.main(String[] args)

It seems the directory which is passed to the filesystemwatcher is always string empty.

tomlokhorst commented 13 years ago

I've been able to reproduce this. Apparently this doesn't throw the exception:

Coffee.exe -w -o test -c .\test.coffee

(Note the extra .\ in front of the filename)

But the issue still remains, and I'll try to fix this in the next release.

On a side note; the whole commandline argument parsing code is a bit wonky. I couldn't find a good library to do argument parsing, so I hacked something together myself. But it's far from perfect, and should really be replaced by a dedicated library, once I find a good one.