From e14a5ff310ddf535ebf7fba2e2e3b47729bd57ec Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Fri, 16 Jun 2023 11:44:11 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20:=20possibilit=C3=A9=20d'appeler=20un?= =?UTF-8?q?=20script=20en=20particulier=20depuis=20updateall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/updateall | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/updateall b/bin/updateall index dc6569c..2848342 100755 --- a/bin/updateall +++ b/bin/updateall @@ -7,6 +7,8 @@ realpath="$(readlink -f "$0")" cd "$(dirname "$realpath")/../share/$(basename "$realpath")" || exit unset realpath +scripts_d=./scripts.d + # Fonction pour fabriquer une ligne de la longueur d'un tiers du terminal makeline() { local cols line @@ -25,8 +27,22 @@ separator() { } # Procédure principale -for i in ./commands.d/*; do - separator "$(basename "$i")" - "$i" -done +main() { + for i in "${scripts_d}/"*; do + separator "$(basename "$i")" + "$i" + done +} + +script="$1" +shift + +case "$script" in + "") + main "$@" + ;; + *) + "${scripts_d}/${script}" "$@" + ;; +esac