zixulu 1.68.13 → 1.68.15

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/dist/index.js CHANGED
@@ -4347,8 +4347,14 @@ async function test() {
4347
4347
  console.log(isSudo);
4348
4348
  console.log(process.argv);
4349
4349
  }
4350
- async function updateDockerImage(images) {
4351
- if (0 === images.length) return void consola.warn("\u6CA1\u6709\u63D0\u4F9B\u955C\u50CF\u540D\u79F0");
4350
+ async function updateDockerCompose() {
4351
+ const dir = await readdir(".");
4352
+ const file = dir.find((item)=>"docker-compose.yml" === item || "docker-compose.yaml" === item);
4353
+ if (!file) throw new Error("docker-compose.yml \u6216 docker-compose.yaml \u6587\u4EF6\u4E0D\u5B58\u5728");
4354
+ const content = await readFile(file, "utf-8");
4355
+ const data = yaml_0.parse(content);
4356
+ const images = Object.values(data.services).map((service)=>service.image);
4357
+ consola.start("\u5F00\u59CB\u66F4\u65B0\u955C\u50CF");
4352
4358
  for (const image of images)await spawnAsync(`docker pull ${image}`, {
4353
4359
  shell: true,
4354
4360
  stdio: "inherit"
@@ -4607,7 +4613,7 @@ program.command("add-build-docker").alias("abd").description("\u6DFB\u52A0\u6784
4607
4613
  program.command("json2type").alias("j2t").argument("[path]", "json \u6587\u4EF6\u8DEF\u5F84").description("\u5C06 json \u8F6C\u6362\u4E3A type").action(json2type_json2type);
4608
4614
  program.command("clear-docker-image").alias("cdi").description("\u6E05\u9664 docker \u60AC\u6302\u955C\u50CF").argument("[name]", "\u955C\u50CF\u540D\u79F0").action(clearDockerImage);
4609
4615
  program.command("clear-docker-log").alias("cdl").description("\u6E05\u9664 docker \u5BB9\u5668\u65E5\u5FD7").argument("name", "\u5BB9\u5668\u540D\u79F0\u6216\u8005 ID").action(clearDockerLog);
4610
- program.command("update-docker-image").alias("udi").description("\u66F4\u65B0 docker \u955C\u50CF").arguments("<images...>").action(updateDockerImage);
4616
+ program.command("update-docker-compose").alias("udc").description("\u66F4\u65B0 docker compose \u955C\u50CF").action(updateDockerCompose);
4611
4617
  program.parse();
4612
4618
 
4613
4619
  //# sourceMappingURL=index.js.map