@fastcar/cli 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/pack.js CHANGED
@@ -101,8 +101,8 @@ async function packProject(projectPath, outputPath, packageManager) {
101
101
  const version = packageJson.version || "0.0.0";
102
102
  const folderName = path.basename(cwd);
103
103
  const defaultOutputDir = outputPath || path.join(cwd, "dist");
104
- const zipFileName = `${projectName}-${version}.zip`;
105
- const zipFilePath = path.join(defaultOutputDir, zipFileName);
104
+ const tgzFileName = `${projectName}-${version}.tgz`;
105
+ const tgzFilePath = path.join(defaultOutputDir, tgzFileName);
106
106
 
107
107
  // 创建临时目录,使用项目文件夹名作为根目录名
108
108
  const tempDir = path.join(cwd, `.pack-temp-${Date.now()}`);
@@ -143,17 +143,17 @@ async function packProject(projectPath, outputPath, packageManager) {
143
143
 
144
144
  // 打包
145
145
  console.log("📦 正在生成压缩包...");
146
- if (fs.existsSync(zipFilePath)) {
147
- fs.rmSync(zipFilePath);
146
+ if (fs.existsSync(tgzFilePath)) {
147
+ fs.rmSync(tgzFilePath);
148
148
  }
149
- await utils.zipFile(rootDir, zipFilePath);
149
+ await utils.zipFile(rootDir, tgzFilePath);
150
150
 
151
151
  console.log("✅ 打包完成!");
152
- console.log(` 输出文件: ${zipFilePath}`);
152
+ console.log(` 输出文件: ${tgzFilePath}`);
153
153
  console.log(` 解压目录: ${folderName}/`);
154
154
 
155
155
  // 计算文件大小
156
- const stats = fs.statSync(zipFilePath);
156
+ const stats = fs.statSync(tgzFilePath);
157
157
  const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
158
158
  console.log(` 文件大小: ${sizeMB} MB`);
159
159
  } catch (error) {