File tree Expand file tree Collapse file tree 3 files changed +7
-15
lines changed
Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 11local json = require (" json" )
2+ local http = require (" http" )
23local nodejsUtils = require (" nodejs_utils" )
34
45--- Return all available versions provided by this plugin
Original file line number Diff line number Diff line change 1+ local nodejsUtils = require (" nodejs_utils" )
12--- When user invoke `use` command, this function will be called to get the
23--- valid version information.
34--- @param ctx table Context information
45function PLUGIN :PreUse (ctx )
5- local runtimeVersion = ctx .runtimeVersion
66 --- user input version
77 local version = ctx .version
8- --- user current used version
9- local previousVersion = ctx .previousVersion
108
11- --- installed sdks
12- local sdkInfo = ctx .installedSdks [' version' ]
13- local path = sdkInfo .path
14- local name = sdkInfo .name
15- local version = sdkInfo .version
9+ local shorthands = nodejsUtils .calculate_shorthand (ctx .installedSdks )
1610
17- --- working directory
18- local cwd = ctx .cwd
19-
20- --- user input scope
21- --- could be one of global/project/session
22- local scope = ctx .scope
11+ if not nodejsUtils .is_semver_simple (version ) then
12+ version = shorthands [version ]
13+ end
2314
2415 --- return the version information
2516 return {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ PLUGIN = {}
55--- Plugin name
66PLUGIN .name = " nodejs"
77--- Plugin version
8- PLUGIN .version = " 0.0.4 "
8+ PLUGIN .version = " 0.0.5 "
99--- Plugin repository
1010PLUGIN .homepage = " https://github.com/version-fox/vfox-nodejs"
1111--- Plugin license
You can’t perform that action at this time.
0 commit comments