heroku-cli-command
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -9,3 +9,3 @@ 'use strict' | ||
if ((process.env.TERM || '').toLowerCase() === 'dumb') return false | ||
if (this.flags['no-color']) return false | ||
if (this.flags && this.flags['no-color']) return false | ||
// TODO: check config file | ||
@@ -12,0 +12,0 @@ return true |
@@ -58,7 +58,7 @@ 'use strict' | ||
this.action = message => { | ||
const Spinner = require('./spinner') | ||
if (this.slack) return this.write(`${message}...`) | ||
if (!this.displayAction) this.writeError(`${message}...`) | ||
else if (this.action.spinner) { | ||
this.action.spinner.text = `${message}...` | ||
} else { | ||
const Spinner = require('./spinner') | ||
this.action.spinner = new Spinner({text: `${message}...`, command: this}) | ||
@@ -95,2 +95,6 @@ this.action.spinner.start() | ||
get displayAction () { | ||
return !this[slack] && process.stdin.isTTY && process.stderr.isTTY && !process.env.CI && process.env.TERM !== 'dumb' | ||
} | ||
get stdout () { | ||
@@ -131,2 +135,12 @@ return this[stdout].join('\n') | ||
write (msg) { | ||
if (this[slack]) this[slack].push(msg) | ||
else process.stdout.write(msg) | ||
} | ||
writeError (msg) { | ||
if (this[slack]) this[slack].push(msg) | ||
else process.stderr.write(msg) | ||
} | ||
styledJSON (obj) { | ||
@@ -133,0 +147,0 @@ let json = JSON.stringify(obj, null, 2) |
@@ -28,8 +28,2 @@ 'use strict' | ||
if (this.id) return | ||
this.enabled = (this.stream && this.stream.isTTY) && !process.env.CI && process.env.TERM !== 'dumb' | ||
if (!this.enabled) { | ||
this.command.write.error(this.text) | ||
return | ||
} | ||
this.stream.write(this.ansi.cursorLeft) | ||
@@ -36,0 +30,0 @@ this.stream.write(this.ansi.eraseLine) |
{ | ||
"name": "heroku-cli-command", | ||
"description": "base Heroku CLI command", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": "Jeff Dickey @dickeyxxx", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/heroku/heroku-cli-command/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152956
2178