Files
kymsu2/kymsu2.sh
Bruno21 61cdb0e44b Bugfix
find -maxdeph
2021-08-09 08:03:03 +02:00

41 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo -e "\033[93m\033[1maltKymsu\033[0m"
echo ""
echo "alt Keep Your macOs Stuff Updated"
echo "a fork from kymsu https://github.com/welcoMattic/kymsu"
echo
echo "USAGE: kymsu2"
echo
echo "Commandes: "
echo " -h, --help display this help"
echo " --nodistract no distract mode (no user interaction)"
echo " --cleanup removing any older versions of installed formulae and clearing old downloads from the Homebrew download-cache"
echo " --npm_cleanup cleaning npm cache"
echo
echo "Tips:"
echo " -prefix the plugin with _ to ignore it"
echo " -see Settings section on top of each plug-in"
echo
exit 0
fi
echo "Please, grab a ☕️, KYMSU keep your working environment up to date!"
SCRIPTS_DIR=$HOME/.kymsu/plugins.d
#SCRIPTS_DIR=$(cat ~/.kymsu/path)/plugins.d
cd "$SCRIPTS_DIR"
# On boucle sur tous les fichiers du répertoire
# (seuls les fichiers commençant par '_' ou '0' sont pris en compte)
#for script in $(find . -name '[_0]*' -maxdepth 1 | sort); do
for script in $(find . -maxdepth 1 ! -name _\*.sh | sort); do
# si le fichier est exécutable et n'est pas un dossier
if [ -x "$SCRIPTS_DIR/$script" ] && [ -f "$SCRIPTS_DIR/$script" ]; then
# on lexécute ; le $@ permet de passer à chaque
# script les arguments passés à *ce* script
$SCRIPTS_DIR/$script $@
fi
done