Gets the Yarn path from the Yarn configuration if present.
(projectDir: string)
| 126 | |
| 127 | /** Gets the Yarn path from the Yarn configuration if present. */ |
| 128 | async function getYarnPathFromConfigurationIfPresent(projectDir: string): Promise<string | null> { |
| 129 | const yarnRc = await findAndParseYarnConfiguration(projectDir); |
| 130 | if (yarnRc === null) { |
| 131 | return null; |
| 132 | } |
| 133 | |
| 134 | const yarnPath = yarnRc['yarn-path'] ?? yarnRc['yarnPath']; |
| 135 | if (yarnPath === undefined) { |
| 136 | return null; |
| 137 | } |
| 138 | |
| 139 | return path.resolve(projectDir, yarnPath); |
| 140 | } |
| 141 | |
| 142 | async function getYarnVersion(info: YarnCommandInfo): Promise<string | null> { |
| 143 | try { |
no test coverage detected