From 9394811a09fe641f1cb5214a7ce913a5ac249bf0 Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Fri, 9 Dec 2016 11:20:43 -0500 Subject: [PATCH] Make `valet install` handle the addition of `tld` to `config.json` --- cli/Valet/Configuration.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/Valet/Configuration.php b/cli/Valet/Configuration.php index be4a97c..c9eee92 100644 --- a/cli/Valet/Configuration.php +++ b/cli/Valet/Configuration.php @@ -111,7 +111,15 @@ function createCertificatesDirectory() function writeBaseConfiguration() { if (! $this->files->exists($this->path())) { - $this->write(['domain' => 'test', 'paths' => []]); + $this->write(['tld' => 'test', 'paths' => []]); + } + + /** + * For upgrades, change config key 'domain' to 'tld' + */ + $config = $this->read(); + if (isset($config['domain']) && !isset($config['tld'])) { + $this->updateKey('tld', $config['domain']); } }