@taole/deploy-helper 1.1.1 → 1.1.2

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/index.mjs CHANGED
@@ -289,7 +289,7 @@ async function main() {
289
289
 
290
290
  const needHandleLight = config.type === "ddfe:cdn";
291
291
  if(needHandleLight){
292
- await lightDeploy(config, mode, version);
292
+ await lightDeploy(config, mode);
293
293
  }
294
294
  const needHandleAssets = config.assets && config.assets.dest;
295
295
 
@@ -52,9 +52,10 @@ async function apiCdnUpload({ distZipPath, prefix, mode, includeHtml, entryHtmlM
52
52
  * light模式部署
53
53
  * @param {*} config 配置
54
54
  * @param {*} mode 部署环境
55
- * @param {*} version 版本号
56
55
  */
57
- export async function lightDeploy(config, mode, version) {
56
+ export async function lightDeploy(config, mode) {
57
+ const projectJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), "package.json"), "utf-8"));
58
+ const version = projectJson.version;
58
59
  log(`light模式, 开始部署`, { mode, prefix: config.prefix, includeHtml: config.includeHtml, version });
59
60
 
60
61
  if (!mode || (mode !== "test" && mode !== "prod")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",