From 03ce9cbf76868b526d71203be521a7af62480cde Mon Sep 17 00:00:00 2001 From: zxypro1 <1018995004@qq.com> Date: Thu, 7 Nov 2024 16:38:28 +0800 Subject: [PATCH] fix: init project fail when if else Signed-off-by: zxypro1 <1018995004@qq.com> --- packages/engine/package.json | 2 +- packages/load-application/package.json | 2 +- packages/load-application/src/v3.ts | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/engine/package.json b/packages/engine/package.json index 5381068..b1eb023 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/engine", - "version": "0.1.5-beta.8", + "version": "0.1.5-beta.9", "description": "a engine lib for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-application/package.json b/packages/load-application/package.json index 41046b0..15e1926 100644 --- a/packages/load-application/package.json +++ b/packages/load-application/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/load-application", - "version": "0.0.15-beta.5", + "version": "0.0.15-beta.6", "description": "load application for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-application/src/v3.ts b/packages/load-application/src/v3.ts index f0e0230..34271a1 100644 --- a/packages/load-application/src/v3.ts +++ b/packages/load-application/src/v3.ts @@ -137,6 +137,7 @@ class LoadApplication { const newData = parse({ appName }, data); fs.writeFileSync(this.spath, newData, 'utf-8'); } else { + this.doArtTemplate(path.join(this.filePath, this.getExtend(this.spath))); // 存在extend,把base yaml也做解析 const data = fs.readFileSync(path.join(this.filePath, this.getExtend(this.spath)), 'utf-8'); const { appName } = this.options; if (isEmpty(appName)) return; @@ -148,9 +149,6 @@ class LoadApplication { private async parseTemplateYaml(postData: Record) { if (isEmpty(this.publishData)) return; this.publishData = { ...this.publishData, ...postData }; - if (!isEmpty(this.getExtend(this.spath))) { - this.doArtTemplate(path.join(this.filePath, this.getExtend(this.spath))); - } return this.doArtTemplate(this.spath); } // 如果存在extend,对extend地址也做一个art-template