Add "symlink" option for "bin-compat" config (#9959)

main
Sebastian Blank 3 years ago committed by GitHub
parent 7157097ea0
commit a9031e40eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -253,11 +253,12 @@ Defaults to `false`. Whether to use the Composer cache in read-only mode.
## bin-compat
Defaults to `auto`. Determines the compatibility of the binaries to be installed.
If it is `auto` then Composer only installs .bat proxy files when on Windows. If
If it is `auto` then Composer only installs .bat proxy files when on Windows or WSL. If
set to `full` then both .bat files for Windows and scripts for Unix-based
operating systems will be installed for each binary. This is mainly useful if you
run Composer inside a linux VM but still want the .bat proxies available for use
in the Windows host OS.
run Composer inside a linux VM but still want the `.bat` proxies available for use
in the Windows host OS. If set to `symlink` Composer will always symlink even on
Windows/WSL.
## prepend-autoloader

@ -251,8 +251,8 @@
"description": "Whether to use the Composer cache in read-only mode."
},
"bin-compat": {
"enum": ["auto", "full"],
"description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed) and can be \"full\" (compatible with both Windows and Unix-based systems)."
"enum": ["auto", "full", "symlink"],
"description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed), can be \"full\" (compatible with both Windows and Unix-based systems) and \"symlink\" (symlink also for WSL)."
},
"discard-changes": {
"type": ["string", "boolean"],

@ -390,7 +390,7 @@ EOT
),
'bin-compat' => array(
function ($val) {
return in_array($val, array('auto', 'full'));
return in_array($val, array('auto', 'full', 'symlink'));
},
function ($val) {
return $val;

@ -92,6 +92,8 @@ class BinaryInstaller
}
} elseif ($this->binCompat === "full") {
$this->installFullBinaries($binPath, $link, $bin, $package);
} elseif ($this->binCompat === "symlink") {
$this->installSymlinkBinaries($binPath, $link);
}
Silencer::call('chmod', $link, 0777 & ~umask());
}

Loading…
Cancel
Save