From ecc12be5310485e3606633fdcd302ff94b08a80b Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 30 Apr 2015 16:54:23 -0600 Subject: [PATCH] restored gpm install functions --- .../src/Grav/Console/Gpm/InstallCommand.php | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/system/src/Grav/Console/Gpm/InstallCommand.php b/system/src/Grav/Console/Gpm/InstallCommand.php index f9b6b9a6f..6e8e40bbe 100644 --- a/system/src/Grav/Console/Gpm/InstallCommand.php +++ b/system/src/Grav/Console/Gpm/InstallCommand.php @@ -352,63 +352,63 @@ class InstallCommand extends Command $this->output->writeln(" '- Installation failed or aborted."); } -// /** -// * @param $package -// */ -// private function processGit($package) -// { -// $matches = $this->getGitRegexMatches($package); -// -// $this->output->writeln("Preparing to Git clone " . $package->name . " from " . $matches[0]); -// -// $this->output->write(" |- Checking destination... "); -// $checks = $this->checkDestination($package); -// -// if (!$checks) { -// $this->output->writeln(" '- Installation failed or aborted."); -// $this->output->writeln(''); -// } else { -// $cmd = 'cd ' . $this->destination . ' && git clone ' . $matches[0] . ' ' . $package->install_path; -// exec($cmd); -// -// // extra white spaces to clear out the buffer properly -// $this->output->writeln(" |- Cloning package... ok "); -// -// $this->output->writeln(" '- Success! "); -// $this->output->writeln(''); -// } -// } -// -// /** -// * @param $package -// */ -// private function processGPM($package) -// { -// $version = isset($package->available) ? $package->available : $package->version; -// -// $this->output->writeln("Preparing to install " . $package->name . " [v" . $version . "]"); -// -// $this->output->write(" |- Downloading package... 0%"); -// $this->file = $this->downloadPackage($package); -// -// $this->output->write(" |- Checking destination... "); -// $checks = $this->checkDestination($package); -// -// if (!$checks) { -// $this->output->writeln(" '- Installation failed or aborted."); -// $this->output->writeln(''); -// } else { -// $this->output->write(" |- Installing package... "); -// $installation = $this->installPackage($package); -// if (!$installation) { -// $this->output->writeln(" '- Installation failed or aborted."); -// $this->output->writeln(''); -// } else { -// $this->output->writeln(" '- Success! "); -// $this->output->writeln(''); -// } -// } -// } + /** + * @param $package + */ + private function processGit($package) + { + $matches = $this->getGitRegexMatches($package); + + $this->output->writeln("Preparing to Git clone " . $package->name . " from " . $matches[0]); + + $this->output->write(" |- Checking destination... "); + $checks = $this->checkDestination($package); + + if (!$checks) { + $this->output->writeln(" '- Installation failed or aborted."); + $this->output->writeln(''); + } else { + $cmd = 'cd ' . $this->destination . ' && git clone ' . $matches[0] . ' ' . $package->install_path; + exec($cmd); + + // extra white spaces to clear out the buffer properly + $this->output->writeln(" |- Cloning package... ok "); + + $this->output->writeln(" '- Success! "); + $this->output->writeln(''); + } + } + + /** + * @param $package + */ + private function processGPM($package) + { + $version = isset($package->available) ? $package->available : $package->version; + + $this->output->writeln("Preparing to install " . $package->name . " [v" . $version . "]"); + + $this->output->write(" |- Downloading package... 0%"); + $this->file = $this->downloadPackage($package); + + $this->output->write(" |- Checking destination... "); + $checks = $this->checkDestination($package); + + if (!$checks) { + $this->output->writeln(" '- Installation failed or aborted."); + $this->output->writeln(''); + } else { + $this->output->write(" |- Installing package... "); + $installation = $this->installPackage($package); + if (!$installation) { + $this->output->writeln(" '- Installation failed or aborted."); + $this->output->writeln(''); + } else { + $this->output->writeln(" '- Success! "); + $this->output->writeln(''); + } + } + } /** * @param $package