Permalink
Browse files

Fix exit properly under non errors

  • Loading branch information...
Kikobeats committed May 7, 2018
1 parent a31b16d commit 36c218e18e459145a76365ac8532ebb80bbe8f12
Showing with 5 additions and 7 deletions.
  1. +1 −1 bin/view/index.js
  2. +4 −6 bin/view/render.js
@@ -69,7 +69,7 @@ module.exports = ({ total, emitter, quiet, verbose, logspeed, ...opts }) => {
setInterval(() => {
bus.emit('render')
if (state.exitCode) process.exit(state.exitCode)
if (!isNil(state.exitCode)) process.exit(state.exitCode)
}, logspeed)
})
}
@@ -67,19 +67,17 @@ const renderLinks = ({ count, links }, { omitErrors = false } = {}) => {
const renderCount = state => {
const { count, end } = state
const total = end ? renderTotal(state) : renderProgress(state)
const header = (() => {
if (!size(count)) return ''
const statusCodes = end ? pick(count, SUCCESS_STATUS_CODES) : count
const statusCodesByCount = map(statusCodes, resumeCount).join(EOL)
return `${EOL}${statusCodesByCount}${EOL}`
return `${EOL}${statusCodesByCount}${EOL}${EOL}`
})()
const footer = `${EOL}${total}`
const links = end ? `${EOL}${renderLinks(state, { omitErrors: true })}` : ''
const links = end ? `${renderLinks(state, { omitErrors: true })}` : ''
const footer = end ? renderTotal(state) : renderProgress(state)
return `${header}${links}${footer}`
return `${header}${links}${footer}${EOL}`
}
const renderResume = state => {

0 comments on commit 36c218e

Please sign in to comment.