fdb958ad4c
Les scripts de updateall sont désormais dans le dossier config
48 lines
832 B
Bash
Executable file
48 lines
832 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Variables
|
|
realpath="$(readlink -f "$0")"
|
|
|
|
# cd
|
|
cd "${HOME}/.config/$(basename "$realpath")" || exit
|
|
unset realpath
|
|
|
|
scripts_d=./scripts
|
|
|
|
# Fonction pour fabriquer une ligne de la longueur d'un tiers du terminal
|
|
makeline() {
|
|
local cols line
|
|
cols="$(($(tput cols) / 3))"
|
|
while [ "${#line}" -lt "$cols" ]; do
|
|
line="${line}${1}"
|
|
done
|
|
printf %s "$line"
|
|
}
|
|
|
|
# Fonction pour afficher un séparateur
|
|
separator() {
|
|
local line
|
|
line="$(makeline '=')"
|
|
printf '\n%s\n\t%s\n%s\n' "$line" "$*" "$line"
|
|
}
|
|
|
|
# Procédure principale
|
|
main() {
|
|
for i in "${scripts_d}/"*; do
|
|
separator "$(basename "$i" | cut -d '-' -f 2)"
|
|
"$i"
|
|
done
|
|
}
|
|
|
|
script="$1"
|
|
shift
|
|
|
|
case "$script" in
|
|
"")
|
|
main "$@"
|
|
;;
|
|
*)
|
|
"${scripts_d}/"??"-${script}" "$@"
|
|
;;
|
|
esac
|
|
|