You are here

public static function ScriptHandler::removeGitDirectories in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.5

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

Remove .git folder from modules, themes, profiles of development branches.

File

src/composer/ScriptHandler.php, line 110

Class

ScriptHandler
Varbase Composer Script Handler.

Namespace

Varbase\composer

Code

public static function removeGitDirectories() {
  $drupal_root = static::getDrupalRoot(getcwd());
  if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    self::removeWindowsGitDirectories($drupal_root);
  }
  else {
    exec("find " . $drupal_root . " -name '.git' | xargs rm -rf");
  }
}