Commit b480c49b authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Utilisation de pull si on est déjà dans la branche

parent d9c89c51
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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
+6 −1
Original line number Diff line number Diff line
@@ -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,
]);


+14 −0
Original line number Diff line number Diff line
@@ -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
     *