()
| 37 | } |
| 38 | |
| 39 | function 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 | |
| 61 | function resolveEmbeddedAssetPath(embeddedPath: string): string { |
| 62 | if (isAbsolute(embeddedPath) && existsSync(embeddedPath)) { |
no test coverage detected