()
| 66 | } |
| 67 | |
| 68 | export function getResourceRoot(): string { |
| 69 | if (cachedResourceRoot) { |
| 70 | return cachedResourceRoot; |
| 71 | } |
| 72 | |
| 73 | const explicitRoot = process.env[RESOURCE_ROOT_ENV_VAR]; |
| 74 | if (explicitRoot) { |
| 75 | cachedResourceRoot = path.resolve(explicitRoot); |
| 76 | return cachedResourceRoot; |
| 77 | } |
| 78 | |
| 79 | const executableRoot = getExecutableResourceRoot(); |
| 80 | if (executableRoot) { |
| 81 | cachedResourceRoot = executableRoot; |
| 82 | return cachedResourceRoot; |
| 83 | } |
| 84 | |
| 85 | cachedResourceRoot = getPackageRoot(); |
| 86 | return cachedResourceRoot; |
| 87 | } |
| 88 | |
| 89 | export function getManifestsDir(): string { |
| 90 | return path.join(getResourceRoot(), 'manifests'); |
no test coverage detected