Banago\PHPloy\Git::command PHP Méthode

command() public méthode

Runs a git command and returns the output (as an array).
public command ( string $command, string $repoPath = null ) : array
$command string "git [your-command-here]"
$repoPath string Defaults to $this->repo
Résultat array Lines of the output
    public function command($command, $repoPath = null)
    {
        if (!$repoPath) {
            $repoPath = $this->repo;
        }
        // "-c core.quotepath=false" in fixes special characters issue like ë, ä, ü etc., in file names
        $command = 'git -c core.quotepath=false --git-dir="' . $repoPath . '/.git" --work-tree="' . $repoPath . '" ' . $command;
        return $this->exec($command);
    }