From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/ava/cli.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'node_modules/ava/cli.js') diff --git a/node_modules/ava/cli.js b/node_modules/ava/cli.js index d9d338941..80151397c 100755 --- a/node_modules/ava/cli.js +++ b/node_modules/ava/cli.js @@ -1,18 +1,11 @@ #!/usr/bin/env node 'use strict'; -const path = require('path'); const debug = require('debug')('ava'); +const importLocal = require('import-local'); -// Prefer the local installation of AVA. -const resolveCwd = require('resolve-cwd'); -const localCLI = resolveCwd('ava/cli'); - -// Use `path.relative()` to detect local AVA installation, -// because __filename's case is inconsistent on Windows -// see https://github.com/nodejs/node/issues/6624 -if (localCLI && path.relative(localCLI, __filename) !== '') { +// Prefer the local installation of AVA +if (importLocal(__filename)) { debug('Using local install of AVA'); - require(localCLI); // eslint-disable-line import/no-dynamic-require } else { if (debug.enabled) { require('time-require'); // eslint-disable-line import/no-unassigned-import -- cgit v1.2.3