@lazycatcloud/lzc-cli 1.3.6 → 1.3.8
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 +8 -0
- package/lib/app/lpk_build.js +9 -1
- package/lib/app/lpk_create.js +1 -0
- package/lib/utils.js +14 -7
- package/package.json +1 -1
- package/template/_lpk/manifest.yml.in +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
|
@@ -178,16 +178,23 @@ export function fakeLoadManifestYml(file) {
|
|
|
178
178
|
subdomain: undefined,
|
|
179
179
|
},
|
|
180
180
|
}
|
|
181
|
+
|
|
181
182
|
res.split("\n").forEach(v => {
|
|
182
|
-
let line = v.trim()
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
let line = v.trim()
|
|
184
|
+
const arr = line.split(":")
|
|
185
|
+
if (arr.length != 2) {
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
let [key, value] = arr
|
|
189
|
+
value = value.trim()
|
|
190
|
+
if (!obj.package && key == "package") {
|
|
191
|
+
obj.package = value
|
|
185
192
|
}
|
|
186
|
-
if (
|
|
187
|
-
obj.application.subdomain =
|
|
193
|
+
if (!obj.application.subdomain && key == "subdomain") {
|
|
194
|
+
obj.application.subdomain = value
|
|
188
195
|
}
|
|
189
|
-
if (
|
|
190
|
-
obj.version =
|
|
196
|
+
if (!obj.version && key == "version") {
|
|
197
|
+
obj.version = value
|
|
191
198
|
}
|
|
192
199
|
})
|
|
193
200
|
return obj
|
package/package.json
CHANGED