zixulu 1.75.1 → 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 +29 -2
- package/dist/index.js.map +1 -1
- package/dist/src/utils/pullDockerImage.d.ts +5 -0
- package/dist/src/utils/syncVscode.d.ts +2 -1
- package/package.json +13 -13
- package/src/index.ts +9 -0
- package/src/utils/addPrettier.ts +1 -0
- package/src/utils/pullDockerImage.ts +18 -0
- package/src/utils/syncVscode.ts +23 -2
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
|
|
@@ -4652,6 +4653,7 @@ var syncVscode_VscodeSyncOption = /*#__PURE__*/ function(VscodeSyncOption) {
|
|
|
4652
4653
|
VscodeSyncOption["配置"] = "SETTING";
|
|
4653
4654
|
VscodeSyncOption["插件"] = "EXTENSION";
|
|
4654
4655
|
VscodeSyncOption["软件"] = "SOFTWARE";
|
|
4656
|
+
VscodeSyncOption["PowerShell"] = "POWERSHELL";
|
|
4655
4657
|
return VscodeSyncOption;
|
|
4656
4658
|
}({});
|
|
4657
4659
|
async function syncVscode() {
|
|
@@ -4724,8 +4726,11 @@ ${options.includes("EXTENSION") ? ` const dir = await readdir("./extensions")
|
|
|
4724
4726
|
for (const file of dir2) {
|
|
4725
4727
|
await rm(join(snippetTarget, file), { force: true })
|
|
4726
4728
|
await copyFile(join("./snippets", file), join(snippetTarget, file))
|
|
4727
|
-
}
|
|
4728
|
-
|
|
4729
|
+
}` : ""}${options.includes("POWERSHELL") ? `
|
|
4730
|
+
${options.includes("SETTING") ? "" : `const userDir = homedir()
|
|
4731
|
+
`}const profile = join(userDir, "Documents/PowerShell/Microsoft.PowerShell_profile.ps1")
|
|
4732
|
+
await copyFile("./Microsoft.PowerShell_profile.ps1", profile)` : ""}
|
|
4733
|
+
}
|
|
4729
4734
|
|
|
4730
4735
|
main()`;
|
|
4731
4736
|
await writeFile(join(dir, "syncVscode.mjs"), script, "utf-8");
|
|
@@ -4735,6 +4740,14 @@ main()`;
|
|
|
4735
4740
|
await download_download("https://code.visualstudio.com/sha/download?build=stable&os=win32-x64", dir);
|
|
4736
4741
|
consola_0.success("下载最新 VSCode 完成");
|
|
4737
4742
|
}
|
|
4743
|
+
if (options.includes("POWERSHELL")) {
|
|
4744
|
+
consola_0.start("开始同步 PowerShell 配置");
|
|
4745
|
+
const userDir = homedir();
|
|
4746
|
+
const profile = join(userDir, "Documents/PowerShell/Microsoft.PowerShell_profile.ps1");
|
|
4747
|
+
const content = await readFile(profile, "utf-8");
|
|
4748
|
+
await writeFile(join(dir, "Microsoft.PowerShell_profile.ps1"), content.replace(/cursor|antigravity/g, "code"));
|
|
4749
|
+
consola_0.success("同步 PowerShell 配置成功");
|
|
4750
|
+
}
|
|
4738
4751
|
} catch (error) {
|
|
4739
4752
|
const { clear } = await inquirer_0.prompt({
|
|
4740
4753
|
type: "confirm",
|
|
@@ -5196,6 +5209,16 @@ async function gdm() {
|
|
|
5196
5209
|
await writeFile(".gdm/gdm.mjs", gdm_script);
|
|
5197
5210
|
await verdaccio();
|
|
5198
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
|
+
}
|
|
5199
5222
|
async function removeOpenWith(name, { file, folder, background }) {
|
|
5200
5223
|
if (!file && !folder && !background) throw new Error("至少选择一个");
|
|
5201
5224
|
let reg = `\ufeffWindows Registry Editor Version 5.00
|
|
@@ -5397,6 +5420,10 @@ program.command("replace-commit-message").alias("rcm").description("替换所有
|
|
|
5397
5420
|
program.command("gdm").description("同步 geshu-docker-management").action(gdm);
|
|
5398
5421
|
program.command("add-open-with").alias("aow").description("添加打开文件的脚本").argument("path", "程序路径").option("--no-file", "是否不添加文件关联").option("--no-folder", "是否不添加文件夹关联").option("--no-background", "是否不添加文件夹空白处关联").action(addOpenWith);
|
|
5399
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
|
+
}));
|
|
5400
5427
|
program.parse();
|
|
5401
5428
|
|
|
5402
5429
|
//# sourceMappingURL=index.js.map
|