report error if binary is a directory (#10463)

file_exists is true also for directory and symlink. but later in generateUnixyProxyCode we call `file_get_contents` on the binary, which fails with `file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory` if the binary is a directory.
main
David Buchmann 2 years ago committed by GitHub
parent af6013093f
commit 6b8f1409e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -77,6 +77,10 @@ class BinaryInstaller
$this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>');
continue;
}
if (is_dir($binPath)) {
$this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': found a directory at that path</warning>');
continue;
}
if (!$this->filesystem->isAbsolutePath($binPath)) {
// in case a custom installer returned a relative path for the
// $package, we can now safely turn it into a absolute path (as we

Loading…
Cancel
Save