From eb699deb71e5f4ed10057cc00af7b62a32f0f436 Mon Sep 17 00:00:00 2001 From: John Nelson Date: Sun, 7 Aug 2016 19:12:13 -0400 Subject: [PATCH 1/2] valet uninstall should remove .valet and dnsmasq setting --- cli/Valet/Caddy.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/Valet/Caddy.php b/cli/Valet/Caddy.php index 7580fb572..ddc972141 100644 --- a/cli/Valet/Caddy.php +++ b/cli/Valet/Caddy.php @@ -136,7 +136,13 @@ 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'); } } From 868e7d52dc1ff091f1eeab8fe154f9f203f57e18 Mon Sep 17 00:00:00 2001 From: John Nelson Date: Sun, 7 Aug 2016 19:12:13 -0400 Subject: [PATCH 2/2] valet uninstall should remove .valet and dnsmasq setting --- cli/Valet/Caddy.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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'); } }