mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 12:20:22 +08:00
fix: 命令撞名只丢那一条;主插件 insert 自愈(#162 #159)
This commit is contained in:
1 parent
2a3c7cef6a
commit
add692e491
7 files changed
+179
-53
No files matched your search
@@ -12,6 +12,7 @@ import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { readPresetDefinition } from './preset-composition.js'
|
||||
import { scheduleClearOwnedSelectedDefault } from '../preset-default.js'
|
||||
import { ensureAllProfileBodyInserts } from '../profile-insert.js'
|
||||
|
||||
/** Cordis 插件名。 */
|
||||
export const name = 'dsh-purge-redteam'
|
||||
@@ -460,6 +461,16 @@ export function installPreset(options = {}) {
|
||||
* @param ctx - 插件上下文。
|
||||
*/
|
||||
export function apply(ctx) {
|
||||
try {
|
||||
const home = process.env.DSH_HOME || join(homedir(), '.dsh')
|
||||
const healed = ensureAllProfileBodyInserts(home)
|
||||
for (const item of healed) {
|
||||
if (item.wrote) {
|
||||
ctx.logger?.info?.('redteam-mode: 已补本体 insert %s(下次启动加载主插件)', item.path)
|
||||
}
|
||||
}
|
||||
} catch { /* 自愈失败不挡预设落地 */ }
|
||||
|
||||
const paths = packagePaths()
|
||||
let result
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user