Skip to content

Commit ee13725

Browse files
Vadim Demedessindresorhus
Vadim Demedes
authored andcommitted
use path.relative() to detect local AVA installation (#993)
1 parent d19d1d1 commit ee13725

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ var debug = require('debug')('ava');
88
var resolveCwd = require('resolve-cwd');
99
var localCLI = resolveCwd('ava/cli');
1010

11-
if (localCLI && localCLI !== __filename) {
11+
// Use path.relative() to detect local AVA installation,
12+
// because __filename's case is inconsistent on Windows
13+
// see https://github.com/nodejs/node/issues/6624
14+
if (localCLI && path.relative(localCLI, __filename) !== '') {
1215
debug('Using local install of AVA');
1316
require(localCLI);
1417
return;

0 commit comments

Comments
 (0)