Skip to content

Commit

Permalink
Merge 507f47d into c8f3b6a
Browse files Browse the repository at this point in the history
  • Loading branch information
KalleV committed Jul 9, 2018
2 parents c8f3b6a + 507f47d commit 11eea8b
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions lib/cli/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import flatiron = require('flatiron')
import path = require('path')
import _ = require('lodash')
import {isPackageSync} from "./utils"
import {checkVersion} from "../check-self-update"
import labShare from '../labshare'
import loaderPlugin = require('./loader-plugin')

const {app} = flatiron,
cwd = process.cwd(),
lscRoot = path.join(__dirname, '..', '..');
const {app} = flatiron;
const cwd = process.cwd();
const lscRoot = path.join(__dirname, '..', '..');

export interface IStartOptions {
directories?: string[]
Expand All @@ -31,12 +30,12 @@ interface IPackageJson {
* @param {string} pattern - The CLI module pattern to search for (glob syntax)
* @param {Array<Function>} initModules - Array of custom initializer functions
*/
export function start({
main = cwd,
directories = [lscRoot],
pattern = '{src/cli,cli}/*.js',
initFunctions = []
}: IStartOptions) {
export async function start({
main = cwd,
directories = [lscRoot],
pattern = '{src/cli,cli}/*.js',
initFunctions = []
}: IStartOptions) {
let pkg: IPackageJson;

checkVersion({name: 'lsc', logger: app.log});
Expand Down Expand Up @@ -77,9 +76,9 @@ export function start({

global.LabShare = labShare;

app.start(error => {
if (_.isError(error)) {
app.log.error(error.stack);
app.start((error) => {
if (error) {
app.log.error(error.stack || 'Command not found!');
process.exit(1);
}
});
Expand Down

0 comments on commit 11eea8b

Please sign in to comment.