#!/usr/bin/env php $plugin) { $plugin = trim($plugin); $repo = $plugin; $branch = 'master'; if (1 === preg_match('#^(.+)\(([^)]+)\)$#', $plugin, $matches)) { $repo = $matches[1]; $branch = $matches[2]; } $pluginTmpName = 'plugin' . $key; $pluginPath = './plugin' . $key; if (is_dir($pluginPath)) { echo shell_exec(sprintf('rm -rf %s', $pluginPath)); } echo sprintf("Installing %s (branch: %s)\n", $repo, $branch); runCommand(sprintf('git clone --single-branch --branch %s %s %s', $branch, $repo, $pluginPath)); runCommand(sprintf('bin/setup plugins:add %s', $pluginPath)); echo shell_exec(sprintf('rm -rf %s', $pluginPath)); }