From fec42507f0391bfbfc110df7faacb3f85d46297a Mon Sep 17 00:00:00 2001 From: jiangxuan Date: Mon, 4 Nov 2019 13:19:54 +0800 Subject: [PATCH 1/2] fix --- frondend/downloadIndexHtml.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frondend/downloadIndexHtml.js b/frondend/downloadIndexHtml.js index acb0d63..158a2fa 100644 --- a/frondend/downloadIndexHtml.js +++ b/frondend/downloadIndexHtml.js @@ -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() From 030f4ff05d86530462c258b8559fe5b03a9ed48d Mon Sep 17 00:00:00 2001 From: jiangxuan Date: Mon, 4 Nov 2019 13:20:30 +0800 Subject: [PATCH 2/2] enhance --- frondend/downloadIndexHtml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frondend/downloadIndexHtml.js b/frondend/downloadIndexHtml.js index 158a2fa..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',