MCPcopy Create free account
hub / github.com/Noumena-Network/code / getRuntimeAssetCandidateDirs

Function getRuntimeAssetCandidateDirs

src/shims/nativeAssetRuntime.ts:39–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39function getRuntimeAssetCandidateDirs(): string[] {
40 const directories = new Set<string>()
41
42 try {
43 directories.add(dirname(fileURLToPath(import.meta.url)))
44 } catch {
45 // Ignore URL resolution failures; other runtime locations may still work.
46 }
47
48 const invokedPath = process.argv[1]
49 if (invokedPath) {
50 directories.add(dirname(resolve(invokedPath)))
51 }
52
53 const execPath = process.execPath || process.argv[0]
54 if (execPath) {
55 directories.add(dirname(resolve(execPath)))
56 }
57
58 return [...directories]
59}
60
61function resolveEmbeddedAssetPath(embeddedPath: string): string {
62 if (isAbsolute(embeddedPath) && existsSync(embeddedPath)) {

Callers 1

resolveEmbeddedAssetPathFunction · 0.85

Calls 2

resolveFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected