Skip to content

Commit af6ee32

Browse files
committed
fix: graalvm home
fix #1
1 parent 6638a4f commit af6ee32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hooks/env_keys.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
local strings = require("vfox.strings")
12
--- Each SDK may have different environment variable configurations.
23
--- This allows plugins to define custom environment variables (including PATH settings)
34
--- Note: Be sure to distinguish between environment variable settings for different platforms!
45
function PLUGIN:EnvKeys(ctx)
56
local mainSdkInfo = ctx.main
67
local path = mainSdkInfo.path
7-
return {
8+
local shortname = strings.split(mainSdkInfo.version, "-")[2]
9+
local envTable = {
810
{
911
key = "JAVA_HOME",
1012
value = path
@@ -14,4 +16,11 @@ function PLUGIN:EnvKeys(ctx)
1416
value = path .. "/bin"
1517
}
1618
}
19+
if shortname == "graal" or shortname == "graalce" then
20+
table.insert(envTable, {
21+
key = "GRAALVM_HOME",
22+
value = path
23+
})
24+
end
25+
return envTable
1726
end

0 commit comments

Comments
 (0)