mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-19 07:06:31 +08:00
add support for nvm current command as the linux nvm has that its missing in windows version
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