mihomo-cli 2.2.2 → 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 +20 -0
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
15
|
+
## [2.2.3] - 2026-05-01
|
|
16
|
+
|
|
17
|
+
### 修复
|
|
18
|
+
|
|
19
|
+
- **非 TUN 模式误触 sudo**:修复 `start` 命令在 mixed 模式下停止旧进程时强制使用 sudo 的问题,改为自动检测是否存在 root 进程再决定是否提权
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
3
23
|
## [2.2.2] - 2026-05-01
|
|
4
24
|
|
|
5
25
|
### 修复
|
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();
|
|
@@ -4993,7 +4993,7 @@ async function cmdStart(args) {
|
|
|
4993
4993
|
const count = status.allProcesses.length > 0 ? status.allProcesses.length : 1;
|
|
4994
4994
|
console.log(`\u505C\u6B62 ${count} \u4E2A\u8FDB\u7A0B...`);
|
|
4995
4995
|
}
|
|
4996
|
-
handleStopResult(stop(
|
|
4996
|
+
handleStopResult(stop());
|
|
4997
4997
|
if (hasProcess) {
|
|
4998
4998
|
console.log(`${colors.green("\u5DF2\u505C\u6B62\u8FDB\u7A0B")}
|
|
4999
4999
|
`);
|
|
@@ -5028,7 +5028,7 @@ async function cmdStart(args) {
|
|
|
5028
5028
|
console.log(`${colors.green("\u5DF2\u6E05\u7406")}: ${formatCleanSummary(cleanResult)}`);
|
|
5029
5029
|
console.log("");
|
|
5030
5030
|
console.log("\u91CD\u65B0\u52A0\u8F7D\u914D\u7F6E...");
|
|
5031
|
-
handleStopResult(stop(
|
|
5031
|
+
handleStopResult(stop());
|
|
5032
5032
|
try {
|
|
5033
5033
|
configInfo = prepareConfigForStart(targetMode, sub.name);
|
|
5034
5034
|
const result = await start(targetMode);
|
|
@@ -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));
|