Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Create the .gitignore file as part of the installation #63

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Symfony/Installer/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
->checkSymfonyVersionIsInstallable()
->download()
->extract()
->createGitIgnore()
->cleanUp()
->checkSymfonyRequirements()
->displayInstallationResult()
Expand Down Expand Up @@ -275,6 +276,33 @@ private function extract()
return $this;
}

/**
* Creates the .gitignore file.
*/
private function createGitIgnore()
{
$ignored = array(
'/web/bundles/',
'/app/bootstrap.php.cache',
'/app/cache/*',
'/app/config/parameters.yml',
'/app/logs/*',
'!app/cache/.gitkeep',
'!app/logs/.gitkeep',
'/app/phpunit.xml',
'/build/',
'/vendor/',
'/bin/',
);

$this->fs->dumpFile(
$this->projectDir.DIRECTORY_SEPARATOR.'.gitignore',
implode(PHP_EOL, $ignored).PHP_EOL
);

return $this;
}

/**
* Removes all the temporary files and directories created to
* download and extract Symfony.
Expand Down