From 5b0e7f4c997e7cefb15a3ebf63c182f80bfae716 Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Fri, 17 Jun 2022 17:04:15 +0200 Subject: [PATCH] Update for cli --- index.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/index.php b/index.php index 05c7c20..ace4171 100644 --- a/index.php +++ b/index.php @@ -5,14 +5,6 @@ function line($line) { echo $line . PHP_EOL; } -line(" xxxxxxx xxxxxxxx xxxxxxxx "); -line(" x x x x x "); -line(" x x x x x "); -line(" xwxxxxx xxxxxxxx x xxxx "); -line(" x x x x x x "); -line(" x x x x x x "); -line(" xxxxxxx x x xxxxxxx "); - function run($command) { line("> $command"); exec($command, $output, $return); @@ -21,31 +13,31 @@ function run($command) { return $return === 0; } -$repository = 'git@git.bluesquare.io:bag/cli.git'; +$repository = 'git@git.bluesquare.io:bluesquare/cli.git'; $home = $_SERVER['HOME'] ?? ($_SERVER['HOMEPATH'] ?? $_SERVER['HOMEDRIVE']); $dir = __DIR__; line("Répertoire utilisateur détecté : $home"); -if (is_dir("$home/.bag")) { - line("Le dossier $home/.bag existe déjà."); +if (is_dir("$home/.bcli")) { + line("Le dossier $home/.bcli existe déjà."); exit(1); } -if (!run("cd $home && git clone $repository .bag")) +if (!run("cd $home && git clone $repository .bcli")) exit(1); -if (!run("cd $home/.bag && composer install")) +if (!run("cd $home/.bcli && composer install")) exit(1); $source = file_exists("$home/.zshrc") ? "$home/.zshrc" : "$home/.bashrc"; $contents = file_exists($source) ? file_get_contents($source) : ""; -if (strpos($contents, ".bag/bin") === false) { +if (strpos($contents, ".bcli/bin") === false) { line("----------------------------------------------------"); line("----------------------------------------------------"); - line("Pour pouvoir utiliser la commande `bag` :"); - line("echo 'export PATH=\"$home/.bag/bin:\$PATH\"' >> $source"); + line("Pour pouvoir utiliser la commande `bcli` :"); + line("echo 'export PATH=\"$home/.bcli/bin:\$PATH\"' >> $source"); line("source $source"); line("----------------------------------------------------"); }