MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / assertDesktopDataDirCompatible

Function assertDesktopDataDirCompatible

apps/desktop/main/runtime-compat.ts:26–44  ·  view source on GitHub ↗
(pathProvider: PathProvider, version: string)

Source from the content-addressed store, hash-verified

24}
25
26export function assertDesktopDataDirCompatible(pathProvider: PathProvider, version: string): RuntimeIdentity {
27 const runtime = createDesktopRuntimeIdentity(version)
28
29 try {
30 assertDataDirCompatible(pathProvider, runtime)
31 } catch (error) {
32 if (
33 error instanceof DataDirCompatibilityError &&
34 error.code === 'DATA_DIR_REQUIRES_NEWER_RUNTIME' &&
35 error.minRuntimeVersion
36 ) {
37 throw new Error(formatDesktopDataDirCompatibilityError(error, runtime), { cause: error })
38 }
39
40 throw error
41 }
42
43 return runtime
44}
45
46function normalizeVersion(version: string | null | undefined): string {
47 return typeof version === 'string' ? version.trim() : ''

Callers 5

initMethod · 0.90
startInternalServerFunction · 0.90
sessionExistsMethod · 0.90

Tested by

no test coverage detected