MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getAppInstallDir

Function getAppInstallDir

apps/desktop/main/utils/pathUtils.ts:208–216  ·  view source on GitHub ↗
(exePath: string)

Source from the content-addressed store, hash-verified

206 * Windows/Linux: 可执行文件所在目录
207 */
208export 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 * 检查目标路径是否位于应用安装目录内(或等于安装目录)

Callers 1

isInsideAppInstallDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected