1
0
Fork 0

Fix error when vendor dir contains broken symlinks (#11670)

pull/11681/head
Uladzimir Tsykun 2023-10-06 09:53:39 +02:00 committed by GitHub
parent cb363b0e84
commit 3e22e1ceda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -251,10 +251,13 @@ class Filesystem
$directory.' exists and is not a directory.'
);
}
if (is_link($directory) && !@$this->unlinkImplementation($directory)) {
throw new \RuntimeException('Could not delete symbolic link '.$directory.': '.(error_get_last()['message'] ?? ''));
}
if (!@mkdir($directory, 0777, true)) {
throw new \RuntimeException(
$directory.' does not exist and could not be created.'
);
throw new \RuntimeException($directory.' does not exist and could not be created: '.(error_get_last()['message'] ?? ''));
}
}
}