diff --git a/frondend/downloadIndexHtml.js b/frondend/downloadIndexHtml.js index acb0d63..bb10465 100644 --- a/frondend/downloadIndexHtml.js +++ b/frondend/downloadIndexHtml.js @@ -8,7 +8,7 @@ const { DEPLOY_TYPE } = process.env const bucketName = DEPLOY_TYPE === 'beta' ? 'beta-assets-tuchuang-space' : 'assets-tuchuang-space' -console.log(`当前发布静态资源的环境为: DEPLOY_TYPE: ${DEPLOY_TYPE}, bucketName: ${bucketName}`) +console.log(`downloadIndexHtml.js: 当前发布静态资源的环境为: DEPLOY_TYPE: ${DEPLOY_TYPE}, bucketName: ${bucketName}`) const client = new Oss({ region: 'oss-cn-hangzhou', @@ -24,4 +24,10 @@ const downloadIndexHtml = async () => { result.stream.pipe(writeStream) } +process.on('unhandledRejection', (reason, promise) => { + // https://nodejs.org/api/process.html#process_event_unhandledrejection + console.log('Unhandled Rejection at:', promise, 'reason:', reason) + process.exit(1) +}) + downloadIndexHtml()