Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

1 changed files with 16 additions and 8 deletions

View File

@ -5,6 +5,14 @@ function line($line) {
echo $line . PHP_EOL; 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) { function run($command) {
line("> $command"); line("> $command");
exec($command, $output, $return); exec($command, $output, $return);
@ -13,31 +21,31 @@ function run($command) {
return $return === 0; return $return === 0;
} }
$repository = 'git@git.bluesquare.io:bluesquare/cli.git'; $repository = 'git@git.bluesquare.io:bag/cli.git';
$home = $_SERVER['HOME'] ?? ($_SERVER['HOMEPATH'] ?? $_SERVER['HOMEDRIVE']); $home = $_SERVER['HOME'] ?? ($_SERVER['HOMEPATH'] ?? $_SERVER['HOMEDRIVE']);
$dir = __DIR__; $dir = __DIR__;
line("Répertoire utilisateur détecté : $home"); line("Répertoire utilisateur détecté : $home");
if (is_dir("$home/.bcli")) { if (is_dir("$home/.bag")) {
line("Le dossier $home/.bcli existe déjà."); line("Le dossier $home/.bag existe déjà.");
exit(1); exit(1);
} }
if (!run("cd $home && git clone $repository .bcli")) if (!run("cd $home && git clone $repository .bag"))
exit(1); exit(1);
if (!run("cd $home/.bcli && composer install")) if (!run("cd $home/.bag && composer install"))
exit(1); exit(1);
$source = file_exists("$home/.zshrc") ? "$home/.zshrc" : "$home/.bashrc"; $source = file_exists("$home/.zshrc") ? "$home/.zshrc" : "$home/.bashrc";
$contents = file_exists($source) ? file_get_contents($source) : ""; $contents = file_exists($source) ? file_get_contents($source) : "";
if (strpos($contents, ".bcli/bin") === false) { if (strpos($contents, ".bag/bin") === false) {
line("----------------------------------------------------"); line("----------------------------------------------------");
line("----------------------------------------------------"); line("----------------------------------------------------");
line("Pour pouvoir utiliser la commande `bcli` :"); line("Pour pouvoir utiliser la commande `bag` :");
line("echo 'export PATH=\"$home/.bcli/bin:\$PATH\"' >> $source"); line("echo 'export PATH=\"$home/.bag/bin:\$PATH\"' >> $source");
line("source $source"); line("source $source");
line("----------------------------------------------------"); line("----------------------------------------------------");
} }