(versionFile: string)
| 299 | * - Trims whitespace. |
| 300 | */ |
| 301 | export function getVersionsInputFromPlainFile(versionFile: string): string[] { |
| 302 | core.debug(`Trying to resolve versions from ${versionFile}`); |
| 303 | const content = fs.readFileSync(versionFile, 'utf8').trim(); |
| 304 | const lines = content.split(/\r\n|\r|\n/); |
| 305 | const versions = lines |
| 306 | .map(line => { |
| 307 | if (line.startsWith('#') || line.trim() === '') { |
| 308 | return undefined; |
| 309 | } |
| 310 | let version: string = line.trim(); |
| 311 | version = version.split('/')[0]; |
| 312 | return version; |
| 313 | }) |
| 314 | .filter(version => version !== undefined) as string[]; |
| 315 | core.info(`Resolved ${versionFile} as ${versions.join(', ')}`); |
| 316 | return versions; |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Python version extracted from a .tool-versions file. |
no outgoing calls
no test coverage detected