[READ-ONLY] Mirror of https://github.com/danielroe/siroc. Zero-config build tooling for Node
bundle node package rollup typescript
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: exit code 1 with bulid errors

closes #196

Daniel Roe (Dec 6, 2020, 11:53 PM UTC) 95f5f2e2 d2617ec6

+13 -1
+11
src/cli/index.ts
··· 14 14 15 15 import { time, timeEnd, RemoveFirst } from './utils' 16 16 17 + let wasErrored = false 18 + const error = consola.error.bind(consola) 19 + consola.error = (message: any, ...args: any[]) => { 20 + wasErrored = true 21 + error(message, ...args) 22 + } 23 + 17 24 time('load root package') 18 25 let rootPackage: Package 19 26 try { ··· 116 123 timeEnd('load CLI') 117 124 118 125 cli.parse() 126 + 127 + process.on('beforeExit', () => { 128 + if (wasErrored) process.exit(1) 129 + }) 119 130 120 131 process.on('unhandledRejection', err => { 121 132 consola.error(err)
+1
src/cli/commands/run.ts
··· 40 40 ) 41 41 } catch (e) { 42 42 pkg.logger.error(`Error running ${bold(fullCommand)}\n`, gray(e)) 43 + process.exit(1) 43 44 } 44 45 } 45 46
+1 -1
src/core/build/index.ts
··· 113 113 await runInParallel(asArray(config.output), async outputConfig => { 114 114 if (!outputConfig) { 115 115 pkg.logger.error('No build defined in generated config.') 116 - return 116 + process.exit(1) 117 117 } 118 118 119 119 const { output } = await bundle.write(outputConfig)