Skip to content

Commit

Permalink
fix: graalvm home
Browse files Browse the repository at this point in the history
fix #1
  • Loading branch information
aooohan committed Apr 11, 2024
1 parent 6638a4f commit af6ee32
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hooks/env_keys.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
local strings = require("vfox.strings")
--- Each SDK may have different environment variable configurations.
--- This allows plugins to define custom environment variables (including PATH settings)
--- Note: Be sure to distinguish between environment variable settings for different platforms!
function PLUGIN:EnvKeys(ctx)
local mainSdkInfo = ctx.main
local path = mainSdkInfo.path
return {
local shortname = strings.split(mainSdkInfo.version, "-")[2]
local envTable = {
{
key = "JAVA_HOME",
value = path
Expand All @@ -14,4 +16,11 @@ function PLUGIN:EnvKeys(ctx)
value = path .. "/bin"
}
}
if shortname == "graal" or shortname == "graalce" then
table.insert(envTable, {
key = "GRAALVM_HOME",
value = path
})
end
return envTable
end

0 comments on commit af6ee32

Please sign in to comment.