cli.js 444 B

1234567891011121314151617
  1. #!/usr/bin/env node
  2. /* eslint-disable import/no-unassigned-import */
  3. 'use strict';
  4. const resolveCwd = require('resolve-cwd');
  5. const hasFlag = require('has-flag');
  6. const localCLI = resolveCwd.silent('xo/cli');
  7. // Prefer the local installation of XO
  8. if (!hasFlag('no-local') && localCLI && localCLI !== __filename) {
  9. const debug = require('debug')('xo');
  10. debug('Using local install of XO');
  11. require(localCLI);
  12. } else {
  13. require('./main');
  14. }