aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ava/cli.js
blob: 80151397c7239f42b60cb89a85a9799165ea3d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env node
'use strict';
const debug = require('debug')('ava');
const importLocal = require('import-local');

// Prefer the local installation of AVA
if (importLocal(__filename)) {
	debug('Using local install of AVA');
} else {
	if (debug.enabled) {
		require('time-require'); // eslint-disable-line import/no-unassigned-import
	}

	try {
		require('./lib/cli').run();
	} catch (err) {
		console.error(`\n  ${err.message}`);
		process.exit(1);
	}
}