This commit is contained in:
aricjean
2026-05-12 13:16:02 -07:00
commit 3af4d06af6
9 changed files with 323 additions and 0 deletions

12
runtime/utils/path.ts Normal file
View File

@@ -0,0 +1,12 @@
import { isWindows } from "std-env";
/**
* 获取跨平台兼容的二进制名称 (逻辑层)
*/
export function getBinName(name: string) {
// 仅在 Windows 且没有后缀时尝试添加 .exe
if (isWindows && !name.endsWith(".exe") && !name.includes(".")) {
return `${name}.exe`;
}
return name;
}