github.com/delicb/asdf-exec@v0.1.3-0.20220111003559-af5f44250ab7/asdf.go (about) 1 package main 2 3 import ( 4 "os" 5 "path" 6 ) 7 8 // GetAsdfDataPath returns the path for asdf 9 func GetAsdfDataPath() string { 10 dir := os.Getenv("ASDF_DATA_DIR") 11 if dir != "" { 12 return dir 13 } 14 return path.Join(os.Getenv("HOME"), ".asdf") 15 } 16 17 // GetPluginPath returns the path of the plugin 18 func GetPluginPath(plugin string) string { 19 return path.Join(GetAsdfDataPath(), "plugins", plugin) 20 }