diff --git a/src/Manager/ProjectInitManager.php b/src/Manager/ProjectInitManager.php index 5326ed6..7bd0cd2 100644 --- a/src/Manager/ProjectInitManager.php +++ b/src/Manager/ProjectInitManager.php @@ -102,7 +102,7 @@ public function createDirectoryStructure( $skipped[] = $gitignoreRelative; } else { if (! $isDryRun) { - $this->filesystem->dumpFile($gitignorePath, "data/\n!data/.gitkeep\nsnapshots/\n!snapshots/.gitkeep\n"); + $this->filesystem->dumpFile($gitignorePath, "data/*\n!data/.gitkeep\nsnapshots/*\n!snapshots/.gitkeep\n"); } $created[] = $gitignoreRelative; diff --git a/tests/Integration/Manager/ProjectInitManagerIntegrationTest.php b/tests/Integration/Manager/ProjectInitManagerIntegrationTest.php index a66f9ed..e738f85 100644 --- a/tests/Integration/Manager/ProjectInitManagerIntegrationTest.php +++ b/tests/Integration/Manager/ProjectInitManagerIntegrationTest.php @@ -72,7 +72,7 @@ public function testCreateDirectoryStructureCreatesGitignore(): void $gitignorePath = $this->tempDir.'/.dde/.gitignore'; self::assertFileExists($gitignorePath); - self::assertSame("data/\n!data/.gitkeep\nsnapshots/\n!snapshots/.gitkeep\n", file_get_contents($gitignorePath)); + self::assertSame("data/*\n!data/.gitkeep\nsnapshots/*\n!snapshots/.gitkeep\n", file_get_contents($gitignorePath)); } public function testDryRunDoesNotCreateAnything(): void diff --git a/tests/Unit/Command/Project/ProjectInitCommandTest.php b/tests/Unit/Command/Project/ProjectInitCommandTest.php index 3f8f590..af71cb4 100644 --- a/tests/Unit/Command/Project/ProjectInitCommandTest.php +++ b/tests/Unit/Command/Project/ProjectInitCommandTest.php @@ -64,7 +64,7 @@ public function testExecuteCreatesGitignore(): void $gitignorePath = $this->tempDir.'/.dde/.gitignore'; $this->assertFileExists($gitignorePath); - $this->assertSame("data/\n!data/.gitkeep\nsnapshots/\n!snapshots/.gitkeep\n", file_get_contents($gitignorePath)); + $this->assertSame("data/*\n!data/.gitkeep\nsnapshots/*\n!snapshots/.gitkeep\n", file_get_contents($gitignorePath)); } public function testExecuteCreatesConfigYaml(): void