When a homestead instance is created locally in a folder containing a . the dot is replaced by a - in the folders mapping but not in the sites mapping. This breaks the installation.
MacOS X 10.12.3
ip: 192.168.10.10
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- { map: /Users/pln/Projects/7s/test.com, to: /home/vagrant/Code/test-com }
sites:
- { map: test.com.app, to: /home/vagrant/Code/test.com/public }
databases:
- homestead
name: test-com
hostname: test-com
Irrelevant
Any . contained in the folder name should be replaced by a - in the sites mapping.
Expected result :
folders:
- { map: /Users/pln/Projects/7s/test.com, to: /home/vagrant/Code/test-com }
sites:
- { map: test.com.app, to: /home/vagrant/Code/test-com/public }
Any . contained in the folder name is replaced by a - in the folders mapping but remains a . in the site mappings which makes the server not working.
Actual :
folders:
- { map: /Users/pln/Projects/7s/test.com, to: /home/vagrant/Code/test-com }
sites:
- { map: test.com.app, to: /home/vagrant/Code/test.com/public }
@pluxain you're right, let me write some tests for it and i will take a look a little latter.
In fact the tests exist but the preconfigured sites folders tests miss the sluggify step.
// tests/MakeCommandTest.php file
/** @test */
public function a_homestead_yaml_settings_has_preconfigured_shared_folders()
{
// ...
$projectDirectory = basename(getcwd());
$projectName = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $projectDirectory))); // Sluggify
// ...
}
/** @test */
public function a_homestead_yaml_settings_has_preconfigured_sites()
{
// ...
$projectName = basename(getcwd());
// Here the sluggify step is missing
// ...
}
This is also true for the json versions of these tests
@pluxain good catch!, i will extract those sluggify steps into methods for readability.
Most helpful comment
@pluxain you're right, let me write some tests for it and i will take a look a little latter.