2017-05-28 00:38:50 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const debug = require('debug')('ava');
|
2017-08-14 05:01:11 +02:00
|
|
|
const importLocal = require('import-local');
|
2017-05-28 00:38:50 +02:00
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
// Prefer the local installation of AVA
|
|
|
|
if (importLocal(__filename)) {
|
2017-05-28 00:38:50 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|