()
| 84 | } |
| 85 | |
| 86 | export function resolveSidecarBinary(): string { |
| 87 | const ext = process.platform === 'win32' ? '.exe' : ''; |
| 88 | const runfilesDir = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR']; |
| 89 | if (runfilesDir) { |
| 90 | const candidates = [ |
| 91 | path.join( |
| 92 | runfilesDir, |
| 93 | `_main/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_bin${ext}`, |
| 94 | ), |
| 95 | path.join( |
| 96 | runfilesDir, |
| 97 | `angular/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_bin${ext}`, |
| 98 | ), |
| 99 | path.join(runfilesDir, `packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_bin${ext}`), |
| 100 | ]; |
| 101 | for (const c of candidates) { |
| 102 | if (fsSync.existsSync(c)) { |
| 103 | return c; |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | const relativeCandidates = [ |
| 108 | path.resolve( |
| 109 | process.cwd(), |
| 110 | `../../packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_bin${ext}`, |
| 111 | ), |
| 112 | path.resolve( |
| 113 | process.cwd(), |
| 114 | `dist/bin/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_bin${ext}`, |
| 115 | ), |
| 116 | ]; |
| 117 | for (const c of relativeCandidates) { |
| 118 | if (fsSync.existsSync(c)) { |
| 119 | return c; |
| 120 | } |
| 121 | } |
| 122 | throw new Error( |
| 123 | `Could not find ng_analyze_bin in runfiles. Checked runfilesDir=${runfilesDir}, cwd=${process.cwd()}`, |
| 124 | ); |
| 125 | } |
| 126 | |
| 127 | function resolvePackagePath(pkg: string): string | null { |
| 128 | const runfilesDir = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR']; |
no test coverage detected