diff --git a/cli/Valet/Configuration.php b/cli/Valet/Configuration.php index 797e234..cf36e83 100644 --- a/cli/Valet/Configuration.php +++ b/cli/Valet/Configuration.php @@ -41,6 +41,8 @@ function install() */ function createConfigurationDirectory() { + $this->files->ensureDirExists(preg_replace('~/valet$~', '', VALET_HOME_PATH), user()); + $oldPath = posix_getpwuid(fileowner(__FILE__))['dir'].'/.valet'; if ($this->files->isDir($oldPath)) { diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index c0dee13..146cf95 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -28,6 +28,7 @@ public function tearDown() public function test_configuration_directory_is_created_if_it_doesnt_exist() { $files = Mockery::mock(Filesystem::class.'[ensureDirExists,isDir]'); + $files->shouldReceive('ensureDirExists')->once()->with(preg_replace('~/valet$~', '', VALET_HOME_PATH), user()); $files->shouldReceive('ensureDirExists')->once()->with(VALET_HOME_PATH, user()); $files->shouldReceive('isDir')->once(); swap(Filesystem::class, $files);