@hyzyn/dsh-safe 0.14.0 → 0.14.1

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.
Files changed (2) hide show
  1. package/lib/repair.js +10 -2
  2. package/package.json +1 -1
package/lib/repair.js CHANGED
@@ -433,13 +433,21 @@ export async function cmdRepairAndBoot(args, { boot, spawn = spawnSync, log = er
433
433
  if (opts.profile && profile !== opts.profile) continue
434
434
  for (const entry of entries ?? []) targets.push({ profile, entry })
435
435
  }
436
+
437
+ // --profile 同时作用于修复与启动:启动参数未显式给 --profile 时自动补上
438
+ const finalBootArgs =
439
+ opts.profile && !bootArgs.some((a) => a === '--profile' || a.startsWith('--profile='))
440
+ ? ['--profile', opts.profile, ...bootArgs]
441
+ : bootArgs
442
+
436
443
  if (!targets.length) {
437
444
  log(t('noRecords'))
438
- if (bootArgs.length) return boot(bootArgs)
445
+ if (bootArgs.length) return boot(finalBootArgs)
439
446
  return 0
440
447
  }
441
448
 
442
449
  const { failed } = await repairBatch(targets, { to: opts.to, yes: opts.yes, dryRun: opts.dryRun, spawn, log, write })
443
- if (bootArgs.length) return boot(bootArgs)
450
+
451
+ if (bootArgs.length) return boot(finalBootArgs)
444
452
  return failed ? 1 : 0
445
453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyzyn/dsh-safe",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "dsh 启动保险丝:社区插件不兼容导致 dsh 启动失败时,自动禁用坏插件并重试",
5
5
  "type": "module",
6
6
  "license": "MIT",