MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / cleanExecCommand

Function cleanExecCommand

src/main/core/commandScanner/linuxScanner.ts:96–101  ·  view source on GitHub ↗

* 清理 Exec 字段中的 % 参数占位符(如 %f, %u, %F, %U ...) * 并提取实际可执行文件路径

(exec: string)

Source from the content-addressed store, hash-verified

94 * 并提取实际可执行文件路径
95 */
96function cleanExecCommand(exec: string): string {
97 return exec
98 .replace(/%[a-zA-Z]/g, '') // 移除 %f %u %F %U 等占位符
99 .replace(/\s+/g, ' ') // 合并多余空格
100 .trim()
101}
102
103// ============================================================
104// 图标解析

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected