@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.
- package/lib/repair.js +10 -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(
|
|
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
|
-
|
|
450
|
+
|
|
451
|
+
if (bootArgs.length) return boot(finalBootArgs)
|
|
444
452
|
return failed ? 1 : 0
|
|
445
453
|
}
|