public function checkout(Plugin $plugin, $path, $branch = null, $useHttp = false)
{
if ($useHttp) {
$cloneUrl = $plugin->cloneUrlHttp;
} else {
$cloneUrl = $plugin->cloneUrlSsh;
}
$pluginName = $plugin->name;
$destPath = $plugin->module . "/" . $plugin->name;
$absPath = $path . '/' . $destPath;
if (is_dir($absPath)) {
$this->updatePlugin($branch, $absPath, $pluginName);
return;
}
$this->installPlugin($branch, $cloneUrl, $absPath, $pluginName);
}