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

Protect against un-parking Valet's core Sites folder

Fixes #956
This commit is contained in:
Chris Brown
2020-06-02 17:09:13 -04:00
committed by GitHub
parent 0d5d81c257
commit 8d9dcd0360

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;