Platformsh\Cli\Local\Toolstack\Drupal::checkIgnored PHP Method

checkIgnored() protected method

Check that an application file is ignored in .gitignore.
protected checkIgnored ( string $filename, string $suggestion = null )
$filename string
$suggestion string
    protected function checkIgnored($filename, $suggestion = null)
    {
        if (!($repositoryDir = $this->gitHelper->getRoot($this->appRoot))) {
            return;
        }
        $relative = $this->fsHelper->makePathRelative($this->appRoot . '/' . $filename, $repositoryDir);
        if (!$this->gitHelper->execute(['check-ignore', $relative], $repositoryDir)) {
            $suggestion = $suggestion ?: $relative;
            $this->output->writeln("<comment>You should exclude this file using .gitignore:</comment> {$suggestion}");
        }
    }