You are here

private static function ScriptHandler::removeWindowsGitDirectories in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.7

Same name and namespace in other branches
  1. 8.8 src/composer/ScriptHandler.php \Varbase\composer\ScriptHandler::removeWindowsGitDirectories()
  2. 8.4 src/composer/ScriptHandler.php \Varbase\composer\ScriptHandler::removeWindowsGitDirectories()
  3. 8.5 src/composer/ScriptHandler.php \Varbase\composer\ScriptHandler::removeWindowsGitDirectories()
  4. 8.6 src/composer/ScriptHandler.php \Varbase\composer\ScriptHandler::removeWindowsGitDirectories()
  5. 9.0.x src/composer/ScriptHandler.php \Varbase\composer\ScriptHandler::removeWindowsGitDirectories()

Find and return the path to .git repository in root folder.

Parameters

string $root:

1 call to ScriptHandler::removeWindowsGitDirectories()
ScriptHandler::removeGitDirectories in src/composer/ScriptHandler.php
Remove .git folder from modules, themes, profiles of development branches.

File

src/composer/ScriptHandler.php, line 165

Class

ScriptHandler
Varbase Composer Script Handler.

Namespace

Varbase\composer

Code

private static function removeWindowsGitDirectories($root) {
  foreach (scandir($root) as $dirOrFile) {
    if ('.' === $dirOrFile || '..' === $dirOrFile) {
      continue;
    }
    if ('.git' === $dirOrFile) {
      self::rmdirWindows($root . '/.git');
    }
    elseif (!is_file($root . '/' . $dirOrFile)) {
      self::removeWindowsGitDirectories($root . '/' . $dirOrFile);
    }
  }
}