Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: use COLUMNS
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 31, 2018
1 parent aa32f97 commit b0b4715
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as path from 'path'
import {castArray, compact, sortBy, template, uniqBy} from '../util'

const normalize = require('normalize-package-data')
const columns = parseInt(process.env.COLUMNS!, 10) || 120

function slugify(input: string): string {
return _.kebabCase(input.trim().replace(/:/g, '')).replace(/[^a-zA-Z0-9\- ]/g, '')
Expand Down Expand Up @@ -140,7 +141,7 @@ USAGE
renderCommand(config: Config.IConfig, c: Config.Command): string {
this.debug('rendering command', c.id)
let title = template({config})(c.description || '').trim().split('\n')[0]
const help = new Help(config, {stripAnsi: true, maxWidth: 120})
const help = new Help(config, {stripAnsi: true, maxWidth: columns})
const header = () => `## \`${config.bin} ${this.commandUsage(c)}\``
return compact([
header(),
Expand Down

0 comments on commit b0b4715

Please sign in to comment.