Closed nauhygon closed 10 years ago
Thanks for finding and fixing this issue. :-)
I notice that (normalize-path (.getPath ...))
is used together quite a lot. Maybe pull it into a local get-path
function?
Thanks for the suggestion. Refactoring done. Tests passed on my Windows and Linux boxes.
Looking good! Thank you. :-)
1.0.1 released
When I tried to use Stasis on my Windows box, I had the following error.
After spending some time, I realized it was Windows' backslashes () in the file names or paths that caused it. In
stasis.core/just-the-filename
, it has(re-pattern (java.io.File/separator))
, equivalent to(re-pattern "\\")
on Windows, which causes the above Exception. It was also preventing the tests from passing on Windows.So I made this fix by adding a new local fun
normalize-path
, which usesjava.util.regex.Pattern/quote
to safe quote the separator (backslashes on Windows). It normalizes the paths so backslashes (\\
) are always converted to forward slashes (/
). I also made a small fix in the Exception message inempty-directory!
so all tests can pass.I am pleased this fixed my problem on Windows, but feel free to discard it if you don't think it's the best way to address the issue. Thanks for making Stasis public.