UNPKG

418 BJavaScriptView Raw
1#!/usr/bin/env node
2'use strict'
3var loudRejection = require('loud-rejection')
4loudRejection()
5
6var resolve = require('resolve')
7var cwd = process.cwd()
8
9var localCLI
10try {
11 localCLI = resolve.sync('mos/bin/mos', { basedir: cwd })
12} catch (err) {
13 localCLI = __filename
14}
15
16if (localCLI && localCLI !== __filename) {
17 console.log('Using local install of mos')
18 require(localCLI)
19} else {
20 require('../dist/cli')
21}