Skip to content

Commit

Permalink
Use custom env file in gitignore when set
Browse files Browse the repository at this point in the history
See #13 and #14
  • Loading branch information
gmazzap committed Sep 26, 2015
1 parent 6e80851 commit f61b110
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wpstarter/src/Setup/Steps/GitignoreStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class GitignoreStep implements FileStepInterface, OptionalStepInterface, PostPro
*/
private $config;

/**
* @var string
*/
private $env;

/**
* @var \WCM\WPStarter\Setup\IO
*/
Expand Down Expand Up @@ -78,6 +83,7 @@ public function __construct(IO $io, FileBuilder $builder)
public function allowed(Config $config, ArrayAccess $paths)
{
$this->config = $config['gitignore'];
$this->env = $config['env-file'];
$this->found = is_file($this->targetPath($paths));

return $this->config !== false;
Expand Down Expand Up @@ -235,7 +241,7 @@ private function create(ArrayAccess $paths)
$filePaths = array_unique(
array_filter(
array_merge(
array('.env', $paths['wp-parent'].'/wp-config.php'),
array($this->env, $paths['wp-parent'].'/wp-config.php'),
$toDo['custom'],
$this->paths($toDo, $paths)
)
Expand Down

0 comments on commit f61b110

Please sign in to comment.