#!/usr/bin/env bash # =========================== Repo=$1 Reponame="USR-$Repo" Repolink="https://git.tyleo.dev/TyleoDvDelaware3217/USR-$Repo" # =========================== # Dossier à vérifier USRDIR="/usr/local/bin" # Vérifie si le dossier contient des fichiers if [ "$(ls -A "$DOSSIER")" ]; then echo "/usr/local/bin is populated ! Cancelled." exit 1 else echo "/usr/local/bin is empty." fi # ========= DEPLOY ========= ## INSTALL GIT if command -v git &> /dev/null; then echo "Git est déjà installé : $(git --version)" return else echo "Détection du système..." if command -v rpm-ostree &> /dev/null; then echo "Système basé sur RPM-OSTree détecté" rpm-ostree install git echo "Redémarrage nécessaire pour finaliser l'installation sur RPM-OSTree" elif [ -f /etc/debian_version ]; then echo "Debian/Ubuntu détecté" sudo apt update sudo apt install -y git elif [ -f /etc/fedora-release ]; then echo "Fedora détecté" sudo dnf install -y git elif [ -f /etc/arch-release ]; then echo "Arch Linux détecté" sudo pacman -Sy --noconfirm git else echo "Distribution non prise en charge" exit 1 fi fi ## INJECT REPO sudo chmod +x sudo git clone $Repolink /usr/local/bin sudo chmod -v +x /usr/local/bin/* sudo ls /usr/local/bin # ==========================