zixulu 1.75.1 → 1.75.2
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 +14 -2
- package/dist/index.js.map +1 -1
- package/dist/src/utils/syncVscode.d.ts +2 -1
- package/package.json +1 -1
- package/src/utils/syncVscode.ts +23 -2
package/dist/index.js
CHANGED
|
@@ -4652,6 +4652,7 @@ var syncVscode_VscodeSyncOption = /*#__PURE__*/ function(VscodeSyncOption) {
|
|
|
4652
4652
|
VscodeSyncOption["配置"] = "SETTING";
|
|
4653
4653
|
VscodeSyncOption["插件"] = "EXTENSION";
|
|
4654
4654
|
VscodeSyncOption["软件"] = "SOFTWARE";
|
|
4655
|
+
VscodeSyncOption["PowerShell"] = "POWERSHELL";
|
|
4655
4656
|
return VscodeSyncOption;
|
|
4656
4657
|
}({});
|
|
4657
4658
|
async function syncVscode() {
|
|
@@ -4724,8 +4725,11 @@ ${options.includes("EXTENSION") ? ` const dir = await readdir("./extensions")
|
|
|
4724
4725
|
for (const file of dir2) {
|
|
4725
4726
|
await rm(join(snippetTarget, file), { force: true })
|
|
4726
4727
|
await copyFile(join("./snippets", file), join(snippetTarget, file))
|
|
4727
|
-
}
|
|
4728
|
-
|
|
4728
|
+
}` : ""}${options.includes("POWERSHELL") ? `
|
|
4729
|
+
${options.includes("SETTING") ? "" : `const userDir = homedir()
|
|
4730
|
+
`}const profile = join(userDir, "Documents/PowerShell/Microsoft.PowerShell_profile.ps1")
|
|
4731
|
+
await copyFile("./Microsoft.PowerShell_profile.ps1", profile)` : ""}
|
|
4732
|
+
}
|
|
4729
4733
|
|
|
4730
4734
|
main()`;
|
|
4731
4735
|
await writeFile(join(dir, "syncVscode.mjs"), script, "utf-8");
|
|
@@ -4735,6 +4739,14 @@ main()`;
|
|
|
4735
4739
|
await download_download("https://code.visualstudio.com/sha/download?build=stable&os=win32-x64", dir);
|
|
4736
4740
|
consola_0.success("下载最新 VSCode 完成");
|
|
4737
4741
|
}
|
|
4742
|
+
if (options.includes("POWERSHELL")) {
|
|
4743
|
+
consola_0.start("开始同步 PowerShell 配置");
|
|
4744
|
+
const userDir = homedir();
|
|
4745
|
+
const profile = join(userDir, "Documents/PowerShell/Microsoft.PowerShell_profile.ps1");
|
|
4746
|
+
const content = await readFile(profile, "utf-8");
|
|
4747
|
+
await writeFile(join(dir, "Microsoft.PowerShell_profile.ps1"), content.replace(/cursor|antigravity/g, "code"));
|
|
4748
|
+
consola_0.success("同步 PowerShell 配置成功");
|
|
4749
|
+
}
|
|
4738
4750
|
} catch (error) {
|
|
4739
4751
|
const { clear } = await inquirer_0.prompt({
|
|
4740
4752
|
type: "confirm",
|