From 1574f6b2d914d420bcaf1350607f0f7bd3c02a7d Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Mon, 29 Dec 2025 10:12:12 +0800 Subject: [PATCH] =?UTF-8?q?chore(release):=20=E5=A2=9E=E5=8A=A0=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E4=B8=8D=E8=BE=93=E5=87=BA=E5=8E=8B=E7=BC=A9=E5=8C=85?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- release.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/release.js b/release.js index 7581c48..f0a6595 100644 --- a/release.js +++ b/release.js @@ -304,7 +304,8 @@ function main() { try { // 解析命令行参数 const args = process.argv.slice(2); - const keepDist = args.includes('--keep-dist') || args.includes('-k') || true; + const keepDist = args.includes('--keep-dist') || args.includes('-k'); + const noZip = args.includes('--no-zip') || args.includes('-n'); // 清理dist目录(如果存在且不保留) if (fs.existsSync(distDir)) { @@ -328,9 +329,13 @@ function main() { const zipFileName = `POCT检测分析平台-定制化-${currentDate}-mp-weixin.zip`; const zipPath = path.join(distDir, zipFileName); - // 创建zip压缩包 - console.log('Creating zip archive...'); - createZipArchive(distDir, zipPath); + // 创建zip压缩包(如果未指定--no-zip参数) + if (!noZip) { + console.log('Creating zip archive...'); + createZipArchive(distDir, zipPath); + } else { + console.log('Skipping zip archive creation (--no-zip specified)'); + } // 清理dist目录(如果不保留) if (!keepDist) { @@ -370,8 +375,7 @@ function main() { console.log('\n=== JS Files with Console Statements After Compression ==='); console.log(`Found ${filesWithConsoleAfterCompression.length} file(s) still containing console statements after compression:`); filesWithConsoleAfterCompression.forEach((file, index) => { - console.log(`\n${index + 1}. Source: ${file.sourcePath}`); - console.log(` Target: ${file.targetPath}`); + console.log(`${index + 1}. ${file.targetPath}`); }); console.log('\n================================================='); } else { @@ -391,5 +395,6 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) { console.log('Usage: node release.js [options]'); console.log('Options:'); console.log(' --keep-dist, -k Keep existing dist directory contents'); + console.log(' --no-zip, -n Skip zip archive creation'); console.log(' --help, -h Show this help message'); } \ No newline at end of file