Commit 51d17f1
committed
refactor(scripts): 优化模块脚本并补全标准注释
性能与健壮性:
- config.sh: strip_quotes 改纯参数展开,read_conf 减少子进程调用
- config.sh: set_conf 改为 awk 原子写入,规避 sed 元字符注入
- nodes.sh: detect_outbound_tag 合并为单次 sed 调用
- runtime.sh: 修正 $'\t'/$'\n' 写法,移除 ls|wc 计数
- service.sh: 启动前增加 require_cmds 依赖检查
- subscription.sh/cli: 临时文件加 PID 后缀并注册 trap 清理,避免并发冲突
bug 修复:
- customize.sh: 修正先读后解压导致首次安装版本号显示"未知"
可读性:
- customize.sh: 抽取 wait_volume_key 复用音量键轮询逻辑
- 为全部脚本补全文件头/函数/逻辑块/全局变量标准注释1 parent 81c6c40 commit 51d17f1
16 files changed
Lines changed: 1150 additions & 312 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | | - | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | | - | |
| 49 | + | |
42 | 50 | | |
0 commit comments