mirror of
https://github.com/wahyd4/jabba.git
synced 2026-08-09 21:06:46 +10:00
19 lines
318 B
Go
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
|
|
}
|