mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
Merge pull request #569 from riazXrazor/support-for-nvm-current
add support for nvm current command
This commit is contained in:
12
src/nvm.go
12
src/nvm.go
@@ -17,6 +17,7 @@ import (
|
||||
"./nvm/arch"
|
||||
"./nvm/file"
|
||||
"./nvm/node"
|
||||
"github.com/blang/semver"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
)
|
||||
|
||||
@@ -115,7 +116,16 @@ func main() {
|
||||
env.proxy = detail
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
case "current":
|
||||
inuse, _ := node.GetCurrentVersion()
|
||||
v, _ := semver.Make(inuse)
|
||||
err := v.Validate()
|
||||
if err == nil {
|
||||
fmt.Println("v" + inuse)
|
||||
} else {
|
||||
fmt.Println(inuse)
|
||||
}
|
||||
|
||||
//case "update": update()
|
||||
case "node_mirror": setNodeMirror(detail)
|
||||
case "npm_mirror": setNpmMirror(detail)
|
||||
|
||||
Reference in New Issue
Block a user