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

Function isInsideAppInstallDir

apps/desktop/main/utils/pathUtils.ts:221–227  ·  view source on GitHub ↗
(targetPath: string, exePath: string)

Source from the content-addressed store, hash-verified

219 * 检查目标路径是否位于应用安装目录内(或等于安装目录)
220 */
221export function isInsideAppInstallDir(targetPath: string, exePath: string): boolean {
222 const installDir = getAppInstallDir(exePath)
223 const normalizedTarget = normalizePathForCompare(targetPath)
224 const normalizedInstall = normalizePathForCompare(installDir)
225
226 return normalizedTarget === normalizedInstall || normalizedTarget.startsWith(`${normalizedInstall}${path.sep}`)
227}

Callers 2

setCustomDataDirFunction · 0.90
registerCacheHandlersFunction · 0.90

Calls 2

getAppInstallDirFunction · 0.85
normalizePathForCompareFunction · 0.70

Tested by

no test coverage detected