diff --git a/src/Command/CoreListerVersions.php b/src/Command/CoreListerVersions.php index e0b820a..d3954bf 100644 --- a/src/Command/CoreListerVersions.php +++ b/src/Command/CoreListerVersions.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class CoreListerVersions extends Command { - private $spip_git_repo = 'https://git.spip.net/spip/spip.git'; + public const _SPIP_GIT_REPO = 'https://git.spip.net/spip/spip.git'; private $versions = []; private $last_xy = ''; private $prev_xy = ''; @@ -47,10 +47,6 @@ class CoreListerVersions extends Command { return Command::FAILURE; } else { - if (!is_dir('.git')) { - $this->gitInit(); - } - $this->versions = $this->listerVersions($type); foreach ($this->versions as $key => $value) { $output->writeln($value); @@ -73,22 +69,6 @@ class CoreListerVersions extends Command { return Command::SUCCESS; } - /** - * gitInit - * - * Initialisation d'un dépôt GIT vierge auquel on déclare le dépôt distant - * du core de spip afin de pouvoir ensuite appeler `git ls-remote origin` - * pour obtenir toutes les branches et tags - * - * @return void - */ - public function gitInit() { - ob_start(); - passthru('git init'); - passthru('git remote add origin ' . $this->spip_git_repo); - ob_end_clean(); - } - /** * listerVersions * @@ -99,7 +79,7 @@ class CoreListerVersions extends Command { $liste = []; if ($type == 'tags') { ob_start(); - passthru('git ls-remote --tags origin'); + passthru('git ls-remote --tags ' . self::_SPIP_GIT_REPO); $tags = ob_get_contents(); ob_end_clean();