You are here

public static function Git::checkIgnore in Drupal 8

Same name and namespace in other branches
  1. 9 composer/Plugin/Scaffold/Git.php \Drupal\Composer\Plugin\Scaffold\Git::checkIgnore()

Determines whether the specified scaffold file is already ignored.

Parameters

string $path: Path to scaffold file to check.

string $dir: Base directory for git process.

Return value

bool Whether the specified file is already ignored or not (TRUE if ignored).

2 calls to Git::checkIgnore()
ManageGitIgnore::manageIgnored in composer/Plugin/Scaffold/ManageGitIgnore.php
Manages gitignore files.
ManageGitIgnore::managementOfGitIgnoreEnabled in composer/Plugin/Scaffold/ManageGitIgnore.php
Determines whether we should manage gitignore files.

File

composer/Plugin/Scaffold/Git.php, line 32

Class

Git
Provide some Git utility operations

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public static function checkIgnore(IOInterface $io, $path, $dir = NULL) {
  $process = new ProcessExecutor($io);
  $output = '';
  $exitCode = $process
    ->execute('git check-ignore ' . $process
    ->escape($path), $output, $dir);
  return $exitCode == 0;
}