From 4ca3e0acb4c279d5c75d5718aa1fc1e134c82790 Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Sun, 11 Nov 2018 16:47:09 -0500 Subject: [PATCH] Sanity check for tld config In some cases of mixed older versions and configs, the 'tld' config entry was not set. This now updates (sets) the `tld` config entry if it is not set. --- cli/valet.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/valet.php b/cli/valet.php index 9d34055..c58d253 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -62,14 +62,17 @@ * Most commands are available only if valet is installed. */ if (is_dir(VALET_HOME_PATH)) { + /** + * Upgrade helper: ensure the tld config exists + */ + if (empty(Configuration::read()['tld'])) { + Configuration::writeBaseConfiguration(); + } + /** * Get or set the TLD currently being used by Valet. */ $app->command('tld [tld]', function ($tld = null) { - if (empty(Configuration::read()['tld'])) { - Configuration::writeBaseConfiguration(); - } - if ($tld === null) { return info(Configuration::read()['tld']); }