Compare commits
3 commits
e178f4d504
...
d1f41b37c0
Author | SHA1 | Date | |
---|---|---|---|
|
d1f41b37c0 | ||
|
573ae6f6ec | ||
|
53febf8df0 |
1 changed files with 4 additions and 29 deletions
|
@ -1,31 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Variables
|
||||
realpath="$(readlink -f "$0")"
|
||||
#!/bin/sh
|
||||
|
||||
# cd
|
||||
cd "${HOME}/.config/$(basename "$realpath")" || exit
|
||||
unset realpath
|
||||
cd "${HOME}/.config/$(basename "$(readlink -f "$0")")" || exit
|
||||
|
||||
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
|
||||
|
@ -34,17 +13,13 @@ main() {
|
|||
done
|
||||
}
|
||||
|
||||
script="$1"
|
||||
shift
|
||||
|
||||
case "$script" in
|
||||
case "$1" in
|
||||
"")
|
||||
main "$@"
|
||||
;;
|
||||
*)
|
||||
# Oui, ShellCheck, c'est bel et bien ce que j'essaie de faire
|
||||
# shellcheck disable=SC2211
|
||||
"${scripts_d}/"??"-${script}" "$@"
|
||||
"${scripts_d}/"??"-${1}" "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in a new issue