diff --git a/discovery.go b/discovery.go index 838d48c..b0192c7 100644 --- a/discovery.go +++ b/discovery.go @@ -36,8 +36,15 @@ import ( // discover tries to find all PHP versions on the current machine func (s *PHPStore) discover() { + userHomeDir := userHomeDir() + s.doDiscover() + if 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 +357,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 -}