mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-11 03:56:46 +00:00
add parsers
This commit is contained in:
19
get-new-tool-versions/parsers/parsers-factory.psm1
Normal file
19
get-new-tool-versions/parsers/parsers-factory.psm1
Normal file
@@ -0,0 +1,19 @@
|
||||
using module "./node-parser.psm1"
|
||||
using module "./go-parser.psm1"
|
||||
using module "./python-parser.psm1"
|
||||
|
||||
function Get-ToolVersionsParser {
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[string]$ToolName
|
||||
)
|
||||
|
||||
switch ($ToolName) {
|
||||
"Node" { return [NodeVersionsParser]::New() }
|
||||
"Go" { return [GoVersionsParser]::New() }
|
||||
"Python" { return [PythonVersionsParser]::New() }
|
||||
Default {
|
||||
throw "Unknown tool name"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user