checkTracked example


  public static function autoloadFileCommitted(IOInterface $io$package_name$web_root) {
    $autoload_path = static::autoloadPath($package_name$web_root);
    $autoload_file = $autoload_path->fullPath();
    $location = dirname($autoload_file);
    if (!file_exists($autoload_file)) {
      return FALSE;
    }
    return Git::checkTracked($io$autoload_file$location);
  }

  /** * Generates a scaffold file path object for the autoload file. * * @param string $package_name * The name of the package defining the autoload file (the root package). * @param string $web_root * The path to the web root. * * @return \Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath * Object wrapping the relative and absolute path to the destination file. */
if (!$this->managementOfGitIgnoreEnabled($options)) {
      return;
    }

    // Accumulate entries to add to .gitignore, sorted into buckets based on the     // location of the .gitignore file the entry should be added to.     $add_to_git_ignore = [];
    foreach ($files as $scaffoldResult) {
      $path = $scaffoldResult->destination()->fullPath();
      $is_ignored = Git::checkIgnore($this->io, $path$this->dir);
      if (!$is_ignored) {
        $is_tracked = Git::checkTracked($this->io, $path$this->dir);
        if (!$is_tracked && $scaffoldResult->isManaged()) {
          $dir = realpath(dirname($path));
          $name = basename($path);
          $add_to_git_ignore[$dir][] = '/' . $name;
        }
      }
    }
    // Write out the .gitignore files one at a time.     foreach ($add_to_git_ignore as $dir => $entries) {
      $this->addToGitIgnore($dir$entries);
    }
  }
Home | Imprint | This part of the site doesn't use cookies.