Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-cli-command

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-cli-command - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

66

lib/output.js

@@ -10,2 +10,10 @@ 'use strict'

function epipe (fn) {
try {
fn()
} catch (err) {
if (err !== 'EPIPE') throw err
}
}
function wrap (msg) {

@@ -126,7 +134,9 @@ return linewrap(6,

log (data, ...args) {
this.action.pause(() => {
if (this[stdout]) this[stdout].push(util.format(data, ...args))
else if (this[slack]) this[slack].push(util.format(data, ...args))
else if (arguments.length === 0) console.log()
else console.log(data, ...args)
epipe(() => {
this.action.pause(() => {
if (this[stdout]) this[stdout].push(util.format(data, ...args))
else if (this[slack]) this[slack].push(util.format(data, ...args))
else if (arguments.length === 0) console.log()
else console.log(data, ...args)
})
})

@@ -136,9 +146,13 @@ }

write (msg) {
if (this[slack]) this[slack].push(msg)
else process.stdout.write(msg)
epipe(() => {
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)
epipe(() => {
if (this[slack]) this[slack].push(msg)
else process.stderr.write(msg)
})
}

@@ -201,19 +215,23 @@

error (err) {
if (typeof err === 'string') {
this.action.pause(() => {
if (this[stderr]) this[stderr].push(err)
else if (this[slack]) this[slack].push(err)
else console.error(err)
})
} else {
if (this.action.spinner) this.action.done(this.color.bold.red('!'))
if (this.debugging) console.error(err.stack)
else console.error(bangify(wrap(getErrorMessage(err)), this.color.red(arrow)))
}
epipe(() => {
if (typeof err === 'string') {
this.action.pause(() => {
if (this[stderr]) this[stderr].push(err)
else if (this[slack]) this[slack].push(err)
else console.error(err)
})
} else {
if (this.action.spinner) this.action.done(this.color.bold.red('!'))
if (this.debugging) console.error(err.stack)
else console.error(bangify(wrap(getErrorMessage(err)), this.color.red(arrow)))
}
})
}
warn (message) {
this.action.pause(() => {
if (this.debugging) console.trace(`WARNING: ${message}`)
else console.error(bangify(wrap(message), this.color.yellow(arrow)))
epipe(() => {
this.action.pause(() => {
if (this.debugging) console.trace(`WARNING: ${message}`)
else console.error(bangify(wrap(message), this.color.yellow(arrow)))
})
})

@@ -224,5 +242,5 @@ }

const ansi = require('ansi-escapes')
process.stderr.write(ansi.cursorShow)
if (process.stderr.isTTY) process.stderr.write(ansi.cursorShow)
}
}
}
{
"name": "heroku-cli-command",
"description": "base Heroku CLI command",
"version": "1.0.0",
"version": "1.0.1",
"author": "Jeff Dickey @dickeyxxx",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/heroku/heroku-cli-command/issues",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc