mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-06 02:26:25 +08:00
Add output parameters for the tool path and version
This allows calling the action multiple times in the same job and retrieving the path and/or version in other steps. Fixes #65
This commit is contained in:
@@ -9,3 +9,23 @@ if (!$java_version.Contains($args[0]))
|
||||
{
|
||||
throw "Unexpected version"
|
||||
}
|
||||
|
||||
if ($args.Count -lt 2 -or !$args[1])
|
||||
{
|
||||
throw "Must supply java path argument"
|
||||
}
|
||||
|
||||
if ($args[1] -ne $Env:JAVA_HOME)
|
||||
{
|
||||
throw "Unexpected path"
|
||||
}
|
||||
|
||||
if ($args.Count -lt 3 -or !$args[2])
|
||||
{
|
||||
throw "Must supply java version argument"
|
||||
}
|
||||
|
||||
if ($args[0] -ne $args[2])
|
||||
{
|
||||
throw "Unexpected version"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user