Files
jabba/command/which.go
T
2016-07-22 12:01:50 -07:00

19 lines
331 B
Go

package command
import (
"path/filepath"
"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 filepath.Join(cfg.Dir(), "jdk", ver), nil
}