mihomo-cli 2.2.3 → 2.2.4
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/CHANGELOG.md +12 -0
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.4] - 2026-05-01
|
|
4
|
+
|
|
5
|
+
### 修复
|
|
6
|
+
|
|
7
|
+
- **reset 命令误触 sudo**:修复 `reset` 停止进程时强制使用 sudo 的问题,改为自动检测是否需要提权
|
|
8
|
+
|
|
9
|
+
### 改进
|
|
10
|
+
|
|
11
|
+
- **重命名 `shortenProxyNames` → `normalizeProxyNamesBeforeSave`**:明确该函数是写入前的预处理步骤,避免误用
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
3
15
|
## [2.2.3] - 2026-05-01
|
|
4
16
|
|
|
5
17
|
### 修复
|
package/dist/index.js
CHANGED
|
@@ -4303,7 +4303,7 @@ function loadSubscriptionConfig(subName) {
|
|
|
4303
4303
|
};
|
|
4304
4304
|
}
|
|
4305
4305
|
function saveSubscriptionConfig(subName, parsed) {
|
|
4306
|
-
|
|
4306
|
+
normalizeProxyNamesBeforeSave(parsed);
|
|
4307
4307
|
parsed.raw.proxies = parsed.proxies;
|
|
4308
4308
|
parsed.raw["proxy-groups"] = parsed.proxyGroups;
|
|
4309
4309
|
saveSubscriptionRawConfig(subName, jsYaml.dump(parsed.raw, YAML_DUMP_OPTS));
|
|
@@ -4526,7 +4526,7 @@ async function testSubscriptionProxies(subName, options = {}) {
|
|
|
4526
4526
|
const alive = results.filter((r) => r.delay !== null).length;
|
|
4527
4527
|
return { total: results.length, alive, dead: results.length - alive, results };
|
|
4528
4528
|
}
|
|
4529
|
-
function
|
|
4529
|
+
function normalizeProxyNamesBeforeSave(parsed) {
|
|
4530
4530
|
const { proxies, proxyGroups } = parsed;
|
|
4531
4531
|
const renameMap = /* @__PURE__ */ new Map();
|
|
4532
4532
|
const usedNames = /* @__PURE__ */ new Set();
|
|
@@ -5240,7 +5240,7 @@ async function cmdReset(args) {
|
|
|
5240
5240
|
const pids = needsStop || warnRunning ? getAllMihomoPids() : [];
|
|
5241
5241
|
if (needsStop && pids.length > 0) {
|
|
5242
5242
|
console.log(`\u505C\u6B62 ${pids.length} \u4E2A\u8FDB\u7A0B...`);
|
|
5243
|
-
cleanupAll(
|
|
5243
|
+
cleanupAll();
|
|
5244
5244
|
for (let i = 0; i < PROCESS_WAIT_ATTEMPTS; i++) {
|
|
5245
5245
|
if (getAllMihomoPids().length === 0) break;
|
|
5246
5246
|
await new Promise((r) => setTimeout(r, PROCESS_WAIT_INTERVAL));
|