zixulu 1.75.2 → 1.76.0

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
@@ -1414,6 +1414,7 @@ const config = {
1414
1414
  plugins: ["@1adybug/prettier"],
1415
1415
  controlStatementBraces: "add",
1416
1416
  multiLineBraces: "add",
1417
+ nodeProtocol: true,
1417
1418
  }
1418
1419
 
1419
1420
  export default config
@@ -5208,6 +5209,16 @@ async function gdm() {
5208
5209
  await writeFile(".gdm/gdm.mjs", gdm_script);
5209
5210
  await verdaccio();
5210
5211
  }
5212
+ async function pullDockerImage({ image, sha256 }) {
5213
+ const match = image.match(/^(.+):(.+)$/);
5214
+ image = match ? match[1] : image;
5215
+ const tag = match ? match[2] : "latest";
5216
+ sha256 = sha256?.replace(/^@?sha256:/, "");
5217
+ if (sha256) {
5218
+ await spawnAsync(`docker pull ${image}@sha256:${sha256}`);
5219
+ await spawnAsync(`docker tag ${image}@sha256:${sha256} ${image}:${tag}`);
5220
+ } else await spawnAsync(`docker pull ${image}:${tag}`);
5221
+ }
5211
5222
  async function removeOpenWith(name, { file, folder, background }) {
5212
5223
  if (!file && !folder && !background) throw new Error("至少选择一个");
5213
5224
  let reg = `\ufeffWindows Registry Editor Version 5.00
@@ -5409,6 +5420,10 @@ program.command("replace-commit-message").alias("rcm").description("替换所有
5409
5420
  program.command("gdm").description("同步 geshu-docker-management").action(gdm);
5410
5421
  program.command("add-open-with").alias("aow").description("添加打开文件的脚本").argument("path", "程序路径").option("--no-file", "是否不添加文件关联").option("--no-folder", "是否不添加文件夹关联").option("--no-background", "是否不添加文件夹空白处关联").action(addOpenWith);
5411
5422
  program.command("remove-open-with").alias("row").description("删除打开文件的脚本").argument("name", "脚本名称").option("--no-file", "是否不删除文件关联").option("--no-folder", "是否不删除文件夹关联").option("--no-background", "是否不删除文件夹空白处关联").action(removeOpenWith);
5423
+ program.command("pull-docker-image").alias("pd").description("拉取 docker 镜像").argument("image", "镜像名称").argument("[sha256]", "镜像 sha256").action((image, sha256)=>pullDockerImage({
5424
+ image,
5425
+ sha256
5426
+ }));
5412
5427
  program.parse();
5413
5428
 
5414
5429
  //# sourceMappingURL=index.js.map