Closed
Description
The CLI is not working for me on Windows, and the issue seems to be with this code:
Lines 11 to 15 in f9fe8f2
if (localCLI && localCLI !== __filename) {
debug('Using local install of AVA');
require(localCLI);
return;
}
The problem is with the use of !==
to compare localCLI
and __filename
. In my case, the two variables hold the following values:
localCLI: c:\workspace\...\node_modules\ava\cli.js
__filename: C:\workspace\...\node_modules\ava\cli.js
As you can see, the drive letter c:
is lowercase in localCLI
and uppercase in __filename
, thus failing the !==
check.
Using !==
to compare paths doesn't seem to be a particularly good idea since there are numerous different ways the exact same path can be encoded. Not sure what the best practice is for comparing paths in node.js is. Perhaps path.relative()
could be used?