You are here

public static function Git::checkIgnore in Drupal 10

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

Determines whether the specified scaffold file is already ignored.

Parameters

\Composer\IO\IOInterface $io: The Composer IO interface.

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 34

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;
}