























@@ -230,13 +230,15 @@ async function disarmNow(params: {
230230}
231231232232if (removed.length > 0 || restored.length > 0) {
233-const next = patchConfigNodeLists(cfg, {
234-allowCommands: uniqSorted([...allow]),
235-denyCommands: uniqSorted([...deny]),
236-});
237-await api.runtime.config.replaceConfigFile({
238-nextConfig: next,
233+await api.runtime.config.mutateConfigFile({
239234afterWrite: { mode: "auto" },
235+mutate: (draft) => {
236+const next = patchConfigNodeLists(draft, {
237+allowCommands: uniqSorted([...allow]),
238+denyCommands: uniqSorted([...deny]),
239+});
240+Object.assign(draft, next);
241+},
240242});
241243}
242244await writeArmState(statePath, null);
@@ -428,13 +430,15 @@ export default definePluginEntry({
428430removedFromDeny.push(cmd);
429431}
430432}
431-const next = patchConfigNodeLists(cfg, {
432-allowCommands: uniqSorted([...allowSet]),
433-denyCommands: uniqSorted([...denySet]),
434-});
435-await api.runtime.config.replaceConfigFile({
436-nextConfig: next,
433+await api.runtime.config.mutateConfigFile({
437434afterWrite: { mode: "auto" },
435+mutate: (draft) => {
436+const next = patchConfigNodeLists(draft, {
437+allowCommands: uniqSorted([...allowSet]),
438+denyCommands: uniqSorted([...denySet]),
439+});
440+Object.assign(draft, next);
441+},
438442});
439443440444await writeArmState(statePath, {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。