8000 Don't restrict homebrew discovery to Mac OS (#11) · symfony-cli/phpstore@81773c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81773c0

Browse files
authored
Don't restrict homebrew discovery to Mac OS (#11)
1 parent 33f2b84 commit 81773c0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

discovery_others.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ func (s *PHPStore) doDiscover() {
5757
// XAMPP
5858
s.addFromDir("/opt/lampp", nil, "XAMPP")
5959

60-
if runtime.GOOS == "darwin" {
61-
// homebrew
62-
if out, err := exec.Command("brew", "--cellar").Output(); err == nil {
63-
prefix := strings.Trim(string(out), "\n")
64-
// pattern example: php@5.6/5.6.33_9
65-
s.discoverFromDir(prefix, nil, regexp.MustCompile("^php@(?:[\\d\\.]+)/(?:[\\d\\._]+)$"), "homebrew")
66-
// pattern example: php/7.2.11
67-
s.discoverFromDir(prefix, nil, regexp.MustCompile("^php/(?:[\\d\\._]+)$"), "homebrew")
68-
}
60+
// homebrew
61+
if out, err := exec.Command("brew", "--cellar").Output(); err == nil {
62+
prefix := strings.Trim(string(out), "\n")
63+
// pattern example: php@5.6/5.6.33_9
64+
s.discoverFromDir(prefix, nil, regexp.MustCompile("^php@(?:[\\d\\.]+)/(?:[\\d\\._]+)$"), "homebrew")
65+
// pattern example: php/7.2.11
66+
s.discoverFromDir(prefix, nil, regexp.MustCompile("^php/(?:[\\d\\._]+)$"), "homebrew")
67+
}
6968

69+
if runtime.GOOS == "darwin" {
7070
// Liip PHP https://php-osx.liip.ch/ (pattern example: php5-7.2.0RC1-20170907-205032/bin/php)
7171
s.discoverFromDir("/usr/local", nil, regexp.MustCompile("^php5\\-[\\d\\.]+(?:RC|BETA)?\\d*\\-\\d+\\-\\d+$"), "Liip PHP")
7272

0 commit comments

Comments
 (0)
0