1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20:08 +01:00

Merge pull request #958 from drbyte/patch-2

Protect against un-parking Valet's core Sites folder
This commit is contained in:
Matt Stauffer
2020-06-02 17:12:28 -04:00
committed by GitHub

View File

@@ -180,6 +180,11 @@ function prependPath($path)
*/
function removePath($path)
{
if ($path == VALET_HOME_PATH.'/Sites') {
info("Cannot remove this directory because this is where Valet stores its site definitions.\nRun [valet paths] for a list of parked paths.");
die();
}
$this->write(tap($this->read(), function (&$config) use ($path) {
$config['paths'] = collect($config['paths'])->reject(function ($value) use ($path) {
return $value === $path;