Banago\PHPloy\Git::command PHP 메소드

command() 공개 메소드

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
리턴 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);
    }