mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
Pre-create the parent .config dir if needed
On a fresh OSX install, the ~/.config/ dir doesn't always exist. This checks and creates it if needed.
This commit is contained in:
committed by
Matt Stauffer
parent
25d6e47eb1
commit
027812c25f
@@ -41,6 +41,8 @@ function install()
|
|||||||
*/
|
*/
|
||||||
function createConfigurationDirectory()
|
function createConfigurationDirectory()
|
||||||
{
|
{
|
||||||
|
$this->files->ensureDirExists(preg_replace('~/valet$~', '', VALET_HOME_PATH), user());
|
||||||
|
|
||||||
$oldPath = posix_getpwuid(fileowner(__FILE__))['dir'].'/.valet';
|
$oldPath = posix_getpwuid(fileowner(__FILE__))['dir'].'/.valet';
|
||||||
|
|
||||||
if ($this->files->isDir($oldPath)) {
|
if ($this->files->isDir($oldPath)) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public function tearDown()
|
|||||||
public function test_configuration_directory_is_created_if_it_doesnt_exist()
|
public function test_configuration_directory_is_created_if_it_doesnt_exist()
|
||||||
{
|
{
|
||||||
$files = Mockery::mock(Filesystem::class.'[ensureDirExists,isDir]');
|
$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('ensureDirExists')->once()->with(VALET_HOME_PATH, user());
|
||||||
$files->shouldReceive('isDir')->once();
|
$files->shouldReceive('isDir')->once();
|
||||||
swap(Filesystem::class, $files);
|
swap(Filesystem::class, $files);
|
||||||
|
|||||||
Reference in New Issue
Block a user