From 11931838990390fc3ccb795931f9d10af66ce02a Mon Sep 17 00:00:00 2001 From: aminnairi <18418459+aminnairi@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:20:51 +0100 Subject: [PATCH] added a new method for authenticating using gh-cli --- modules/00-library.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/00-library.sh b/modules/00-library.sh index 311963a..3b1f861 100644 --- a/modules/00-library.sh +++ b/modules/00-library.sh @@ -300,3 +300,21 @@ function ensure_mkinitcpio_configured_for() { log "Echec lors de l'installation du noyau $kernel, ne redémarrez surtout pas !" fi } + +function ensure_github_cli_authenticated() { + if gh auth status > /dev/null 2>&1 + then + log "Déjà connecté à GitHub CLI." + return 0 + fi + + log "Déconnecté de GitHub CLI, connexion..." + + if ! gh auth login + then + log "Echec d'authentification à GitHub CLI." + return 1 + else + log "Connecté à GitHub CLI avec succès." + fi +}