diff --git a/cli/Valet/Caddy.php b/cli/Valet/Caddy.php index 7580fb572..57b0e16fb 100644 --- a/cli/Valet/Caddy.php +++ b/cli/Valet/Caddy.php @@ -136,7 +136,14 @@ public function uninstall() $this->cli->quietly('systemctl disable caddy.service'); $this->files->unlink($this->daemonPath); - + // remove .valet files + $files = glob('/home/'.$_SERVER['SUDO_USER'].'/.valet/*'); // get all file names + foreach ($files as $file) { // iterate files + if (is_file($file)) { + unlink($file); + } // delete file + } + $this->cli->quietly('sed -i \'/conf-file=\/home\/'.$_SERVER['SUDO_USER'].'\/.valet\/dnsmasq.conf/d\' /etc/dnsmasq.conf'); $this->cli->quietly('systemctl daemon-reload'); } }