init
This commit is contained in:
12
runtime/utils/path.ts
Normal file
12
runtime/utils/path.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user