(exePath: string)
| 206 | * Windows/Linux: 可执行文件所在目录 |
| 207 | */ |
| 208 | export function getAppInstallDir(exePath: string): string { |
| 209 | if (process.platform === 'darwin') { |
| 210 | const appBundleMatch = exePath.match(/^(.+?\.app)(\/|$)/) |
| 211 | if (appBundleMatch) { |
| 212 | return appBundleMatch[1] |
| 213 | } |
| 214 | } |
| 215 | return path.dirname(exePath) |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * 检查目标路径是否位于应用安装目录内(或等于安装目录) |
no outgoing calls
no test coverage detected