diff --git a/cli/includes/helpers.php b/cli/includes/helpers.php index aeba4711e..8c91b21ad 100644 --- a/cli/includes/helpers.php +++ b/cli/includes/helpers.php @@ -14,6 +14,8 @@ define('VALET_SERVER_PATH', realpath(__DIR__ . '/../../server.php')); define('VALET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45'); +define('VALET_LEGACY_HOME_PATH', $_SERVER['HOME'].'/.valet'); + /** * Output the given text to the console. * diff --git a/cli/valet.php b/cli/valet.php index fdb6b0859..3a918690b 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -17,6 +17,13 @@ use function Valet\table; use function Valet\warning; +/** + * Relocate config dir to ~/.config/valet/ if found in old location. + */ +if (is_dir(VALET_LEGACY_HOME_PATH) && !is_dir(VALET_HOME_PATH)) { + Configuration::createConfigurationDirectory(); +} + /** * Create the application. */