Skip to content

Commit

Permalink
✨ 💡 Make sure not use the Code subfolder in vagrant, should use top…
Browse files Browse the repository at this point in the history
… level (#601)

There is no reason to add another folder inside vagrant that we map our projects to. This change will elimnate sites being placed in `/home/vagrant/Code/` and place them in `/home/vagrant/`
  • Loading branch information
svpernova09 authored Jun 22, 2017
1 parent 6a558d4 commit 2962877
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Settings/HomesteadSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function configureSites($projectName, $projectDirectory)
{
$site = [
'map' => "{$projectName}.app",
'to' => "/home/vagrant/Code/{$projectDirectory}/public",
'to' => "/home/vagrant/{$projectDirectory}/public",
];

if (isset($this->attributes['sites']) && ! empty($this->attributes['sites'])) {
Expand Down Expand Up @@ -131,7 +131,7 @@ public function configureSharedFolders($projectPath, $projectDirectory)
{
$folder = [
'map' => $projectPath,
'to' => "/home/vagrant/Code/{$projectDirectory}",
'to' => "/home/vagrant/{$projectDirectory}",
];

$this->update(['folders' => [$folder]]);
Expand Down
8 changes: 4 additions & 4 deletions tests/MakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public function a_homestead_yaml_settings_has_preconfigured_sites()

$this->assertEquals([
'map' => "{$projectDirectory}.app",
'to' => "/home/vagrant/Code/{$projectName}/public",
'to' => "/home/vagrant/{$projectName}/public",
], $settings['sites'][0]);
}

Expand All @@ -458,7 +458,7 @@ public function a_homestead_json_settings_has_preconfigured_sites()

$this->assertEquals([
'map' => "{$projectDirectory}.app",
'to' => "/home/vagrant/Code/{$projectName}/public",
'to' => "/home/vagrant/{$projectName}/public",
], $settings['sites'][0]);
}

Expand All @@ -485,7 +485,7 @@ public function a_homestead_yaml_settings_has_preconfigured_shared_folders()
// The curious thing is that both directories point to the same location.
//
$this->assertRegExp("/{$projectDirectory}/", $settings['folders'][0]['map']);
$this->assertEquals("/home/vagrant/Code/{$projectName}", $settings['folders'][0]['to']);
$this->assertEquals("/home/vagrant/{$projectName}", $settings['folders'][0]['to']);
}

/** @test */
Expand Down Expand Up @@ -513,7 +513,7 @@ public function a_homestead_json_settings_has_preconfigured_shared_folders()
// The curious thing is that both directories point to the same location.
//
$this->assertRegExp("/{$projectDirectory}/", $settings['folders'][0]['map']);
$this->assertEquals("/home/vagrant/Code/{$projectName}", $settings['folders'][0]['to']);
$this->assertEquals("/home/vagrant/{$projectName}", $settings['folders'][0]['to']);
}

/** @test */
Expand Down
8 changes: 4 additions & 4 deletions tests/Settings/JsonSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function it_can_configure_its_sites()
'sites' => [
[
'map' => 'homestead.app',
'to' => '/home/vagrant/Code/Laravel/public',
'to' => '/home/vagrant/Laravel/public',
'type' => 'laravel',
'schedule' => true,
],
Expand All @@ -134,7 +134,7 @@ public function it_can_configure_its_sites()
$attributes = $settings->toArray();
$this->assertEquals([
'map' => 'test.com.app',
'to' => '/home/vagrant/Code/test-com/public',
'to' => '/home/vagrant/test-com/public',
'type' => 'laravel',
'schedule' => true,
], $attributes['sites'][0]);
Expand All @@ -146,7 +146,7 @@ public function it_can_configure_its_shared_folders()
$settings = new JsonSettings([
'folders' => [
'map' => '~/Code',
'to' => '/home/vagrant/Code',
'to' => '/home/vagrant/',
],
]);

Expand All @@ -155,7 +155,7 @@ public function it_can_configure_its_shared_folders()
$attributes = $settings->toArray();
$this->assertEquals([
'map' => '/a/path/for/project_name',
'to' => '/home/vagrant/Code/project_name',
'to' => '/home/vagrant/project_name',
], $attributes['folders'][0]);
}
}
8 changes: 4 additions & 4 deletions tests/Settings/YamlSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function it_can_configure_its_sites()
'sites' => [
[
'map' => 'homestead.app',
'to' => '/home/vagrant/Code/Laravel/public',
'to' => '/home/vagrant/Laravel/public',
'type' => 'laravel',
'schedule' => true,
],
Expand All @@ -135,7 +135,7 @@ public function it_can_configure_its_sites()
$attributes = $settings->toArray();
$this->assertEquals([
'map' => 'test.com.app',
'to' => '/home/vagrant/Code/test-com/public',
'to' => '/home/vagrant/test-com/public',
'type' => 'laravel',
'schedule' => true,
], $attributes['sites'][0]);
Expand All @@ -147,7 +147,7 @@ public function it_can_configure_its_shared_folders()
$settings = new YamlSettings([
'folders' => [
'map' => '~/Code',
'to' => '/home/vagrant/Code',
'to' => '/home/vagrant',
],
]);

Expand All @@ -156,7 +156,7 @@ public function it_can_configure_its_shared_folders()
$attributes = $settings->toArray();
$this->assertEquals([
'map' => '/a/path/for/project_name',
'to' => '/home/vagrant/Code/project_name',
'to' => '/home/vagrant/project_name',
], $attributes['folders'][0]);
}
}

0 comments on commit 2962877

Please sign in to comment.