(localpath, rootDir)
| 358 | } |
| 359 | |
| 360 | #getFileContents(localpath, rootDir) { |
| 361 | let filepath; |
| 362 | let searchLocations = []; |
| 363 | |
| 364 | if(rootDir) { |
| 365 | searchLocations.push(TemplatePath.absolutePath(rootDir, localpath)); |
| 366 | } |
| 367 | |
| 368 | // fallbacks for file:../ installations |
| 369 | searchLocations.push(TemplatePath.absolutePath(__dirname, localpath)); |
| 370 | searchLocations.push(TemplatePath.absolutePath(__dirname, "../../../", localpath)); |
| 371 | |
| 372 | for(let loc of searchLocations) { |
| 373 | if(fs.existsSync(loc)) { |
| 374 | filepath = loc; |
| 375 | break; |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | return this.#readFile(filepath); |
| 380 | } |
| 381 | |
| 382 | augmentContentWithNotifier(content, inlineContents = false, options = {}) { |
| 383 | let { integrityHash, scriptContents } = options; |
no test coverage detected