Skip to content

Commit aa1c425

Browse files
committed
init
0 parents  commit aa1c425

15 files changed

Lines changed: 203 additions & 0 deletions

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vfox-plugin-template.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.tool-versions

Whitespace-only changes.

LICENSE

Whitespace-only changes.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# vfox-plugin-template

hooks/available.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Return all available versions provided by this plugin
2+
--- @param ctx table Empty table used as context, for future extension
3+
--- @return table Descriptions of available versions and accompanying tool descriptions
4+
function PLUGIN:Available(ctx)
5+
local runtimeVersion = ctx.runtimeVersion
6+
return {
7+
{
8+
version = "xxxx",
9+
note = "LTS",
10+
addition = {
11+
{
12+
name = "npm",
13+
version = "8.8.8",
14+
}
15+
}
16+
}
17+
}
18+
end

hooks/env_keys.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--- Each SDK may have different environment variable configurations.
2+
--- This allows plugins to define custom environment variables (including PATH settings)
3+
--- Note: Be sure to distinguish between environment variable settings for different platforms!
4+
--- @param ctx table Context information
5+
--- @field ctx.path string SDK installation directory
6+
function PLUGIN:EnvKeys(ctx)
7+
--- this variable is same as ctx.sdkInfo['plugin-name'].path
8+
local mainPath = ctx.path
9+
local runtimeVersion = ctx.runtimeVersion
10+
local mainSdkInfo = ctx.main
11+
local mpath = mainSdkInfo.path
12+
local mversion = mainSdkInfo.version
13+
local mname = mainSdkInfo.name
14+
local sdkInfo = ctx.sdkInfo['sdk-name']
15+
local path = sdkInfo.path
16+
local version = sdkInfo.version
17+
local name = sdkInfo.name
18+
return {
19+
{
20+
key = "JAVA_HOME",
21+
value = mainPath
22+
},
23+
{
24+
key = "PATH",
25+
value = mainPath .. "/bin"
26+
},
27+
{
28+
key = "PATH",
29+
value = mainPath .. "/bin2"
30+
},
31+
32+
}
33+
34+
end

hooks/post_install.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- Extension point, called after PreInstall, can perform additional operations,
2+
--- such as file operations for the SDK installation directory or compile source code
3+
--- Currently can be left unimplemented!
4+
function PLUGIN:PostInstall(ctx)
5+
--- ctx.rootPath SDK installation directory
6+
local rootPath = ctx.rootPath
7+
local runtimeVersion = ctx.runtimeVersion
8+
local sdkInfo = ctx.sdkInfo['sdk-name']
9+
local path = sdkInfo.path
10+
local version = sdkInfo.version
11+
local name = sdkInfo.name
12+
end

0 commit comments

Comments
 (0)