diff --git a/discovery.go b/discovery.go index 838d48c..a3d6d88 100644 --- a/discovery.go +++ b/discovery.go @@ -38,6 +38,11 @@ import ( func (s *PHPStore) discover() { s.doDiscover() + if userHomeDir := userHomeDir(); userHomeDir != "" { + // Herd-lite + s.addFromDir(filepath.Join(userHomeDir, ".config", "herd-lite", "bin"), nil, "php.new (Herd-lite)") + } + // Under $PATH paths := s.pathDirectories(s.configDir) s.log("Looking for PHP in the PATH (%s)", paths) @@ -350,3 +355,11 @@ func (s *PHPStore) pathDirectories(configDir string) []string { } return dirs } + +func userHomeDir() string { + userHomeDir, err := os.UserHomeDir() + if err != nil { + return "" + } + return userHomeDir +} diff --git a/discovery_windows.go b/discovery_windows.go index f1cbe10..df42801 100644 --- a/discovery_windows.go +++ b/discovery_windows.go @@ -60,11 +60,3 @@ func systemDir() string { } return filepath.VolumeName(cwd) + "\\" } - -func userHomeDir() string { - userHomeDir, err := os.UserHomeDir() - if err != nil { - return "" - } - return userHomeDir -}