File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,19 @@ func composerVersion() int {
132
132
}
133
133
134
134
func findComposer (extraBin string ) (string , error ) {
135
+ // Special Support for NixOS. It needs to run before the PATH detection
136
+ // because NixOS adds a shell wrapper that we can't run via PHP.
137
+ for _ , path := range strings .Split (os .Getenv ("buildInputs" ), " " ) {
138
+ nixPharPath := filepath .Join (path , "libexec/composer/composer.phar" )
139
+ d , err := os .Stat (nixPharPath )
140
+ if err != nil {
141
+ continue
142
+ }
143
+ if m := d .Mode (); ! m .IsDir () {
144
+ // Yep!
145
+ return nixPharPath , nil
146
+ }
147
+ }
135
148
for _ , file := range []string {extraBin , "composer" , "composer.phar" } {
136
149
if pharPath , _ := LookPath (file ); pharPath != "" {
137
150
// On Windows, we don't want the .bat, but the real composer phar/PHP file
You can’t perform that action at this time.
0 commit comments