






















@@ -8,10 +8,8 @@ import type { PluginInstallRecord } from "../config/types.plugins.js";
88import { enablePluginInConfig } from "../plugins/enable.js";
99import {
1010loadInstalledPluginIndexInstallRecords,
11-PLUGIN_INSTALLS_CONFIG_PATH,
1211removePluginInstallRecordFromRecords,
1312withoutPluginInstallRecords,
14-writePersistedInstalledPluginIndexInstallRecords,
1513withPluginInstallRecords,
1614} from "../plugins/installed-plugin-index-records.js";
1715import { listMarketplacePlugins } from "../plugins/marketplace.js";
@@ -44,6 +42,7 @@ import {
4442} from "./plugins-command-helpers.js";
4543import { setPluginEnabledInConfig } from "./plugins-config.js";
4644import { runPluginInstallCommand } from "./plugins-install-command.js";
45+import { commitPluginInstallRecordsWithConfig } from "./plugins-install-record-commit.js";
4746import { formatPluginLine } from "./plugins-list-format.js";
4847import { refreshPluginRegistryAfterConfigMutation } from "./plugins-registry-refresh.js";
4948import { resolvePluginUninstallId } from "./plugins-uninstall-selection.js";
@@ -691,17 +690,18 @@ export function registerPluginsCli(program: Command) {
691690defaultRuntime.log(theme.warn(warning));
692691}
693692694-await writePersistedInstalledPluginIndexInstallRecords(
695-removePluginInstallRecordFromRecords(installRecords, pluginId),
696-);
697-await replaceConfigFile({
698-nextConfig: withoutPluginInstallRecords(result.config),
693+const nextInstallRecords = removePluginInstallRecordFromRecords(installRecords, pluginId);
694+const nextConfig = withoutPluginInstallRecords(result.config);
695+await commitPluginInstallRecordsWithConfig({
696+previousInstallRecords: installRecords,
697+ nextInstallRecords,
698+ nextConfig,
699699 ...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
700-writeOptions: { unsetPaths: [Array.from(PLUGIN_INSTALLS_CONFIG_PATH)] },
701700});
702701await refreshPluginRegistryAfterConfigMutation({
703-config: withoutPluginInstallRecords(result.config),
702+config: nextConfig,
704703reason: "source-changed",
704+installRecords: nextInstallRecords,
705705logger: {
706706warn: (message) => defaultRuntime.log(theme.warn(message)),
707707},
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。