Files
jabba/command/which.go
T
2016-03-26 16:09:25 -07:00

19 lines
318 B
Go

package command
import (
"path"
"github.com/shyiko/jabba/cfg"
)
func Which(selector string) (string, error) {
aliasValue := GetAlias(selector)
if aliasValue != "" {
selector = aliasValue
}
ver, err := LsBestMatch(selector)
if err != nil {
return "", err
}
return path.Join(cfg.Dir(), "jdk", ver), nil
}