From aa1be48a6a939c2f453015e27aa460435aa782c9 Mon Sep 17 00:00:00 2001 From: 72161674 Date: Fri, 16 Jun 2023 14:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddist=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=89=93=E5=8C=85=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/examples/sample.test.js | 4 +--- packages/hap-toolkit/src/gen-webpack-conf/helpers.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/__tests__/examples/sample.test.js b/__tests__/examples/sample.test.js index efeb10dc..e0d5375a 100644 --- a/__tests__/examples/sample.test.js +++ b/__tests__/examples/sample.test.js @@ -153,11 +153,9 @@ describe('hap-toolkit', () => { } }) expect(sourceArr.join('\n\n')).toMatchSnapshot(identifierArr.join('\n\n')) - const rpks = await lsfiles('dist/*.rpk', { cwd }) - const hasCustom = rpks[0].indexOf('dev') !== -1 + const hasCustom = rpks.some((item) => item.indexOf('dev') !== -1) expect(hasCustom).toBeTruthy() - expect(json.assets.map((a) => a.name).sort()).toMatchSnapshot('assets list') const output = stripAnsi(outputs.join('\n')) // TODO expect(wipe(output)).toMatchSnapshot('outputs') diff --git a/packages/hap-toolkit/src/gen-webpack-conf/helpers.js b/packages/hap-toolkit/src/gen-webpack-conf/helpers.js index 08a97981..ac551f4e 100644 --- a/packages/hap-toolkit/src/gen-webpack-conf/helpers.js +++ b/packages/hap-toolkit/src/gen-webpack-conf/helpers.js @@ -38,7 +38,7 @@ export function cleanup(BUILD_DIR, DIST_DIR) { zipfiles.forEach(function (file) { const curPath = DIST_DIR + '/' + file if (fs.statSync(curPath).isFile()) { - fs.unlinkSync(curPath) + // fs.unlinkSync(curPath) } }) }