@lazycatcloud/lzc-cli 1.3.6 → 1.3.7
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/changelog.md +4 -0
- package/lib/app/lpk_build.js +9 -1
- package/lib/app/lpk_create.js +1 -0
- package/lib/utils.js +3 -3
- package/package.json +1 -1
package/changelog.md
CHANGED
package/lib/app/lpk_build.js
CHANGED
|
@@ -211,6 +211,9 @@ export class LpkBuild {
|
|
|
211
211
|
let lpkM = new LpkManifest()
|
|
212
212
|
await lpkM.init(this.manifestFilePath)
|
|
213
213
|
this.manifest = lpkM.manifest
|
|
214
|
+
// manifest使用 text/template模板时,标记为异常manifest
|
|
215
|
+
// 创建lpk时,直接将源文件拷入 lpk
|
|
216
|
+
this.excpManifest = lpkM.excpManifest
|
|
214
217
|
|
|
215
218
|
if (!isValidPackageName(this.manifest["package"])) {
|
|
216
219
|
throw `${this.manifest["package"]} 含有非法字符,请使用正确的包名格式(java的包名格式),如:cloud.lazycat.apps.video`
|
|
@@ -331,7 +334,12 @@ export class LpkBuild {
|
|
|
331
334
|
)
|
|
332
335
|
} else {
|
|
333
336
|
logger.debug("manifest\n", manifest)
|
|
334
|
-
|
|
337
|
+
// 异常的manifest,就将源文件给转到lpk内
|
|
338
|
+
if (this.excpManifest) {
|
|
339
|
+
fs.writeFileSync(path.join(tempDir, "manifest.yml"), fs.readFileSync(this.manifestFilePath, "utf8"))
|
|
340
|
+
} else {
|
|
341
|
+
dumpToYaml(manifest, path.join(tempDir, "manifest.yml"))
|
|
342
|
+
}
|
|
335
343
|
}
|
|
336
344
|
|
|
337
345
|
// compose.override.yml
|
package/lib/app/lpk_create.js
CHANGED
package/lib/utils.js
CHANGED
|
@@ -180,13 +180,13 @@ export function fakeLoadManifestYml(file) {
|
|
|
180
180
|
}
|
|
181
181
|
res.split("\n").forEach(v => {
|
|
182
182
|
let line = v.trim().replace(" ", "")
|
|
183
|
-
if (line.includes("package") && line.split(":").length == 2) {
|
|
183
|
+
if (!obj.package && line.includes("package:") && line.split(":").length == 2) {
|
|
184
184
|
obj.package = line.split(":")[1]
|
|
185
185
|
}
|
|
186
|
-
if (line.includes("subdomain") && line.split(":").length == 2) {
|
|
186
|
+
if (!obj.application.subdomain && line.includes("subdomain:") && line.split(":").length == 2) {
|
|
187
187
|
obj.application.subdomain = line.split(":")[1]
|
|
188
188
|
}
|
|
189
|
-
if (line.includes("version") && line.split(":").length == 2) {
|
|
189
|
+
if (!obj.version && line.includes("version:") && line.split(":").length == 2) {
|
|
190
190
|
obj.version = line.split(":")[1]
|
|
191
191
|
}
|
|
192
192
|
})
|