Compare commits

..

No commits in common. "d1f41b37c0c1eabc16b1973da5a53b5a816ab5cb" and "e178f4d504e97d31f4c9b210717cb81e0cb195e2" have entirely different histories.

View file

@ -1,10 +1,31 @@
#!/bin/sh
#!/bin/bash
# Variables
realpath="$(readlink -f "$0")"
# cd
cd "${HOME}/.config/$(basename "$(readlink -f "$0")")" || exit
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
@ -13,13 +34,17 @@ main() {
done
}
case "$1" in
script="$1"
shift
case "$script" in
"")
main "$@"
;;
*)
# Oui, ShellCheck, c'est bel et bien ce que j'essaie de faire
# shellcheck disable=SC2211
"${scripts_d}/"??"-${1}" "$@"
"${scripts_d}/"??"-${script}" "$@"
;;
esac