Loading admin/actions/test.php +10 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ //$bdd = new \BddAdmin\Bdd(Config::get('bdds', 'dev-local')); //$schema = new \BddAdmin\Schema($bdd); $t = $oa->getTags(); $ts = $c->exec("git branch", false); var_dump($t); No newline at end of file $branch = null; foreach ($ts as $t) { if (0 === strpos($t, '*')) { $branch = trim(substr($t, 1)); break; } } var_dump($branch); No newline at end of file admin/actions/update.php +6 −1 Original line number Diff line number Diff line Loading @@ -39,9 +39,14 @@ if (!($oa->tagIsValid($version) || $oa->brancheIsValid($version))) { // Récupération des sources $c->println("\nMise à jour des fichiers à partir de GIT", $c::COLOR_LIGHT_CYAN); $tbr = $oa->tagIsValid($version) ? 'tags/' : ''; if ($version == $oa->getCurrentBranche()) { $updcmd = 'git pull'; } else { $updcmd = "git checkout $tbr$version"; } $c->passthru([ "cd $osedir", "git checkout $tbr$version", $updcmd, ]); Loading admin/src/OseAdmin.php +14 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,20 @@ class OseAdmin public function getCurrentBranche(): ?string { $ts = $this->console->exec("git branch", false); foreach ($ts as $t) { if (0 === strpos($t, '*')) { return trim(substr($t, 1)); } } return null; } /** * @param string $tag * Loading Loading
admin/actions/test.php +10 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ //$bdd = new \BddAdmin\Bdd(Config::get('bdds', 'dev-local')); //$schema = new \BddAdmin\Schema($bdd); $t = $oa->getTags(); $ts = $c->exec("git branch", false); var_dump($t); No newline at end of file $branch = null; foreach ($ts as $t) { if (0 === strpos($t, '*')) { $branch = trim(substr($t, 1)); break; } } var_dump($branch); No newline at end of file
admin/actions/update.php +6 −1 Original line number Diff line number Diff line Loading @@ -39,9 +39,14 @@ if (!($oa->tagIsValid($version) || $oa->brancheIsValid($version))) { // Récupération des sources $c->println("\nMise à jour des fichiers à partir de GIT", $c::COLOR_LIGHT_CYAN); $tbr = $oa->tagIsValid($version) ? 'tags/' : ''; if ($version == $oa->getCurrentBranche()) { $updcmd = 'git pull'; } else { $updcmd = "git checkout $tbr$version"; } $c->passthru([ "cd $osedir", "git checkout $tbr$version", $updcmd, ]); Loading
admin/src/OseAdmin.php +14 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,20 @@ class OseAdmin public function getCurrentBranche(): ?string { $ts = $this->console->exec("git branch", false); foreach ($ts as $t) { if (0 === strpos($t, '*')) { return trim(substr($t, 1)); } } return null; } /** * @param string $tag * Loading