Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: updated cli-ux
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 20, 2018
1 parent 91c27e3 commit b0848e5
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 32 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/dxcli/command/issues",
"dependencies": {
"@dxcli/config": "^0.1.17",
"@dxcli/config": "^0.1.18",
"@dxcli/parser": "^0.0.2",
"@dxcli/screen": "^0.0.0",
"cli-ux": "^3.1.0",
"cli-ux": "^3.1.1",
"debug": "^3.1.0",
"http-call": "^5.0.1"
},
"devDependencies": {
"@dxcli/dev": "^1.1.3",
"@dxcli/dev-semantic-release": "^0.0.3",
"@dxcli/dev-test": "^0.2.2",
"@dxcli/dev-test": "^0.4.0",
"@dxcli/dev-tslint": "^0.0.15",
"@types/node": "^9.3.0",
"@types/read-pkg": "^3.0.0",
"@types/semver": "^5.4.0",
"eslint": "^4.15.0",
"eslint": "^4.16.0",
"eslint-config-dxcli": "^1.1.4",
"husky": "^0.14.3",
"mocha": "^5.0.0",
Expand Down
9 changes: 5 additions & 4 deletions src/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const pjson = require('../package.json')
import * as Config from '@dxcli/config'
import {args} from '@dxcli/parser'
import cli from 'cli-ux'
import {HTTP} from 'http-call'

import deps from './deps'
Expand Down Expand Up @@ -74,7 +75,7 @@ export default abstract class Command {
if (this.config && this.config.engine) {
await this.config.engine.runHook('error', err)
}
deps.cli.error(err)
cli.error(err)
}
}

Expand All @@ -84,7 +85,7 @@ export default abstract class Command {
global['http-call']!.userAgent = this.config.userAgent
this.debug = require('debug')(`cli:command:${this.ctor.id || this.config.name}`)
this.debug('init version: %s argv: %o', this.ctor._base, argv)
deps.cli.config.errlog = this.config.errlog
cli.config.errlog = this.config.errlog
try {
const parse = await deps.Parser.parse({
argv,
Expand All @@ -105,9 +106,9 @@ export default abstract class Command {

protected async done() {
try {
await deps.cli.done()
await cli.done()
} catch (err) {
deps.cli.warn(err)
cli.warn(err)
}
}
}
2 changes: 0 additions & 2 deletions src/deps.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import Parser = require('@dxcli/parser')
import CLI = require('cli-ux')

import errors = require('./errors')

export const deps = {
// remote
get cli(): typeof CLI.default { return fetch('cli-ux').default },
get Parser(): typeof Parser { return fetch('@dxcli/parser') },

// local
Expand Down
Loading

0 comments on commit b0848e5

Please sign in to comment.