15 Commits

Author SHA1 Message Date
2bb6671836 installed.sh
-les fichiers Brewfile_* vieux de plus de 10 jours sont supprimés
-la section paquets Atom est désormais optionnelle
2025-04-17 09:31:08 +02:00
ea87685dde venv.sh
soco-cli est désormais installé avec pipx
2025-04-17 09:26:37 +02:00
ce8d9b799e Update Python for PEP668 2024-08-05 23:18:29 +02:00
2124781520 nodejs.sh
-update for latest npm / node compatibility
2024-05-14 07:05:53 +02:00
dc4764c832 Test connection
-replace google.com by apple.com
2024-05-14 07:04:20 +02:00
40040c264b pipx.sh
bug in pipx -> pips list —quiet
2024-01-09 18:05:36 +01:00
b76e72a1ef Test internet connection
-run scripts only if internet is ok
2023-11-16 15:00:35 +01:00
c8ced14004 venv.sh
-add streamrip to apps list
2023-11-14 20:27:59 +01:00
6ee801d946 Bugfix
-json casks list
2023-08-01 13:53:54 +02:00
feab0bb267 nodejs
-add a do_not_update option
2023-01-05 16:55:18 +01:00
02ed39943b Rust plugin
1st version
2022-11-25 10:26:39 +01:00
bcd4ca41c6 homebrew.sh
-add a test to not proceed any bash upgrade.
2022-11-08 22:03:33 +01:00
d13e3277b1 minor bugfix 2022-08-03 15:39:57 +02:00
de82e3f6a3 kymsu.sh
-bugfix
2022-07-17 16:57:17 +02:00
db3ef113ad Auto-update
-add a preference file $HOME/.kymsu/plugins.d/kymsu.pref
-add a preference for setting auto-update from github repo
2022-07-17 16:56:38 +02:00
14 changed files with 417 additions and 88 deletions

View File

@@ -21,6 +21,7 @@ homebrew and pecl plugins notifie you if apache/php configuration files have bee
- **perl** (Perl modules ([cpan](https://metacpan.org)))
- **pip** ([Python Package index](https://pypi.org)) (pip or pip3)
- **pipx** ([Python Apps in Isolated Environments](https://pypa.github.io/pipx/))
- **rust** ([Rust](https://www.rust-lang.org))
- **venv** ([Environnement virtuel Python](https://docs.python.org/3/library/venv.html))
- **wp** (WordPress [wp-cli](https://wp-cli.org/fr/)) <u>(for testing only)</u>
@@ -77,7 +78,7 @@ Prefix plugin with a _ to ignore it:
There is a <u>settings section</u> on top of each plug-in:
- *[homebrew-pip]* don't update a module, package...: add it to the `do_not_update` array on the top.
- *[homebrew-pip-nodejs]* don't update a module, package...: add it to the `do_not_update` array on the top.
```bash
$ nano homebrew.sh
@@ -85,9 +86,9 @@ declare -a do_not_update=('virtualbox,virtualbox-extension-pack')
```
- *[homebrew]* display info on updated pakages: `display_info=true`
- *[homebrew-npm-pecl-pip]* no distract mode (no user interaction): `no_distract=false`
- *[homebrew-nodejs-pecl-pip]* no distract mode (no user interaction): `no_distract=false`
*If running Homebrew plug-in in no_distract mode, Casks with 'latest' version number won't be updated.*
- *[npm]* run npm maintenance tools: `doctor=true`
- *[nodejs]* run npm maintenance tools: `doctor=true`
- *[pip]* `version=pip or pip3` `user="" or "--user"`

View File

@@ -36,6 +36,7 @@ function showHelp() {
all_plugins=false
no_distract=false
brew_cleanup=false
SCRIPTS_DIR=$HOME/.kymsu/plugins.d
while getopts "hncs: a-:" opt
do
@@ -62,23 +63,26 @@ done
#shift "$((OPTIND-1))"
SCRIPTS_DIR=$HOME/.kymsu/plugins.d
# -n : non vide
if [ -n "$one_script" ]; then
# Un seul script
list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f -name "*$one_script.sh" -a -perm +111)
#list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f -name "*$one_script" -a -perm +111)
list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f -name "$one_script" -o -name "_$one_script" -a -perm +111)
[ -z "$list_plugins" ] && echo -e "❗️ No named plugin ${italic}$one_script${reset}" && exit -1
# [[ $@ =~ "--all" ]] && all_plugins=true || all_plugins=false
elif [ "$all_plugins" = false ]; then
# Tous sauf commençant par _ (les fichiers commençant par '_' ne sont pas pris en compte) "_*.sh"
list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f ! -name "_*" -a -name "*.sh" -a -perm +111 | sort)
[ -z "$list_plugins" ] && echo -e "❗️ No plugin in ${italic}$SCRIPTS_DIR${reset}" && exit -1
else
# Tous (-a = ET; -perm +111 = exec)
list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f -name "*.sh" -a -perm +111 | sort)
[ -z "$list_plugins" ] && echo -e "❗️ No plugin in ${italic}$SCRIPTS_DIR${reset}" && exit -1
fi
cd "$SCRIPTS_DIR"
<<COMMENT
@@ -97,6 +101,7 @@ echo ""
for script in $list_plugins; do
# le $@ permet de passer à chaque script les arguments passés à *ce* script
$script $@
#echo "$script"
done
shift "$((OPTIND-1))"

View File

@@ -1,6 +1,57 @@
#!/usr/bin/env bash
echo "🦄 KYMSU self update"
pushd "$(cat ~/.kymsu/path)" > /dev/null
git pull
popd > /dev/null
echo ""
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
#PREF_FILE="$SCRIPT_DIR/kymsu.pref"
#TEMP_FILE="$SCRIPT_DIR/kymsu.pref.tmp"
PREF_FILE="$HOME/.kymsu/plugins.d/kymsu.pref"
TEMP_FILE="$HOME/.kymsu/plugins.d/kymsu.pref.tmp"
# 5m 5 minutes
# 2h 2 hours
# 4d 4 days
# 3w 3 weeks
# 1M 1 month
# 1Y 1 year
update_interval="1w"
x=${update_interval: -1}
case $x in
m) unite=60;;
h) unite=3600;;
d) unite=$(( 3600*24 ));;
w) unite=$(( 3600*24*7 ));;
M) unite=$(( 3600*24*30 ));;
Y) unite=$(( 3600*24*30*12 ));;
*) echo "Bad update_interval pref" >&2
#exit -1;;
esac
y=$(( ${#update_interval}-1 ))
nb=${update_interval:0:$y}
w=$(( unite*nb ))
if [ -f $PREF_FILE ]; then
last_update=$(cat $PREF_FILE | grep "last.update" | awk -F"=" '{print $2}' )
else
last_update=0
fi
current_timestamp=$(date +"%s")
temps=$(( current_timestamp-last_update))
if [ $(( temps-w)) -gt 0 ]; then
echo "🦄 KYMSU self update"
pushd "$(cat ~/.kymsu/path)" > /dev/null
#git pull
git pull https://Bruno21@github.com/Bruno21/kymsu.git
popd > /dev/null
echo ""
if [ $last_update -eq 0 ]; then
echo "last.update=$current_timestamp" > $PREF_FILE
else
awk -F'=' -v OFS='=' -v newval="$current_timestamp" '/^last.update/{$2=newval;print;next}1' $PREF_FILE > $TEMP_FILE
mv $TEMP_FILE $PREF_FILE
fi
fi

View File

@@ -74,7 +74,7 @@ get_info_cask() {
#auto_updates=$(echo "$info" | jq -r '.[] | select(.token == "'${app}'") | (.auto_updates)')
#caveats=$(echo "$info" | jq -r '.[] | select(.token == "'${app}'") | (.caveats)')
installed_versions=$(echo "$upd_cask" | jq -r '.[] | select(.name == "'${app}'") | (.installed_versions)')
installed_versions=$(echo "$upd_cask" | jq -r '.[] | select(.name == "'${app}'") | (.installed_versions)' | jq -r '.[]')
current_version=$(echo "$upd_cask" | jq -r '.[] | select(.name == "'${app}'") | (.current_version)')
[[ "$desc" = "null" ]] && desc="${italic}No description${reset}"
@@ -117,6 +117,7 @@ get_info_pkg() {
#echo -e "installed: $installed\n"
installed_versions=$(echo "$upd_package" | jq -r '.[] | select(.name == "'${pkg2}'") | (.installed_versions)' | jq -r '.[]')
current_version=$(echo "$upd_package" | jq -r '.[] | select(.name == "'${pkg2}'") | (.current_version)')
#echo -e "installed_versions: $installed_versions\n"
#echo "stable: $current_version"
@@ -151,6 +152,13 @@ get_info_pkg() {
echo -e "${bold}🍺 Homebrew ${reset}"
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
echo -e "\n🍺 ${underline}Updating brew...${reset}\n"
brew update
@@ -240,6 +248,11 @@ if [ -n "$upd_pkg_notpinned" ]; then
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
for i in $upd_pkg_notpinned;
do
if [ "$i" == "bash" ]; then
echo -e "\nBash update available !"
echo -e "You should run ${bold}brew upgrade bash${reset} in another terminal !\n"
continue
fi
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo "$i" | xargs -p -n 1 brew upgrade
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
@@ -272,11 +285,12 @@ upd_cask=$(echo "$brew_outdated" | jq '{casks} | .[]')
# parse error: Unfinished string at EOF at line 2, column 0
# parse error: Invalid numeric literal at line 1, column 7
#echo "$upd_cask"
for row in $(jq -c '.[]' <<< "$upd_cask");
do
name=$(echo "$row" | jq -j '.name')
installed_versions=$(echo "$row" | jq -j '.installed_versions')
installed_versions=$(echo "$row" | jq -j '.installed_versions | .[]')
current_version=$(echo "$row" | jq -j '.current_version')
if [ "$current_version" != "latest" ]; then
@@ -490,6 +504,11 @@ echo -e "\n🍺 ${underline}The Doc is checking that everything is ok...${reset}
brew doctor
echo "python-cryptography required by certbot"
echo "python-certifi required by certbot and yt-dlp"
echo "numpy required ffmpeg and openvin"
# suprimer: python-packaging python-argcomplete
brew missing
status=$?
if [ $status -ne 0 ]; then brew missing --verbose; fi

View File

@@ -14,12 +14,14 @@ chemin=$HOME/Documents/kymsu
#version: pip ou pip3
pip_version=pip3
#
# https://github.com/atom/apm/tags
apm=false
#########################################
#if [ ! -d chemin ]; then mkdir $chemin; fi
mkdir -p $chemin
now=$(date +"%d-%m-%Y_%T")
now=$(date +"%d-%m-%Y_%T" | sed 's/://g')
mac=$(hostname -s)
file=$mac"@"$now
filename="Installed_$file"
@@ -152,24 +154,25 @@ echo ''
# atom
echo -e "⚛️ Get \033[3m\033[93mAtom editor packages\033[0m installed list"
atom=$(apm list | grep 'Community Packages' -A 100 | sed '1,1d')
{
echo '## ⚛️ Atom packages'
echo ''
echo "\`\`\`bash"
if [ "$apm" = "true" ]; then
echo -e "⚛️ Get \033[3m\033[93mAtom editor packages\033[0m installed list"
atom=$(apm list | grep 'Community Packages' -A 100 | sed '1,1d')
{
echo '## ⚛️ Atom packages'
echo ''
echo "\`\`\`bash"
while read -r line; do
a=$(echo "$line" | awk -F "@" '{print $1}' | awk '{print $2}' )
#atom_pkg=${a:4}
echo "$a"
done <<< "$atom"
echo "\`\`\`"
echo ""
echo ''
} >> $chemin/Installed.md
while read -r line; do
a=$(echo "$line" | awk -F "@" '{print $1}' | awk '{print $2}' )
#atom_pkg=${a:4}
echo "$a"
done <<< "$atom"
echo "\`\`\`"
echo ""
echo ''
} >> $chemin/Installed.md
fi
# Node.js packages (npm)
echo -e "🌿 Get npm \033[3m\033[93m node global packages\033[0m installed scripts"
@@ -235,11 +238,16 @@ echo ''
echo -e "🍺 Create a \033[3m\033[93mBrewfile\033[0m:"
echo "list all of the installed brew packages, cask applications, and Mac App Store applications currently on the machine..."
brew bundle dump
echo ''
echo -e "To restore everything listed in that file, run \033[3m\033[93m'$ brew bundle'\033[0m in folder that contains the Brewfile."
echo -e "To restore everything listed in that file, run \033[3m\033[93m'brew bundle'\033[0m in folder that contains the Brewfile."
echo ''
mv Brewfile "$chemin/Brewfile"
mv $chemin/Brewfile "$chemin/Brewfile_$file".md
y=$(find . -type f -name 'Brewfile*' -mtime +10 -maxdepth 1)
if [ -n "$y" ]; then
nb=$(echo "$y" | wc -l)
echo "$y" | xargs rm
[ $? ] && echo -e "\033[93m$nb Brewfile_*\033[0m files removed !"
fi
#iconv -f macroman -t utf-8 Installed.md > Installed-utf8.md
#mv Installed-utf8.md "$filename".md

1
plugins.d/kymsu.pref Normal file
View File

@@ -0,0 +1 @@
last.update=1658067929

View File

@@ -24,12 +24,17 @@ display_info=true
doctor=true
# Set update_node to true to update node.
update_node=false
update_node=true
# Local install:
# run 'npm init' in local_path to create package.json
local_path=$HOME/Sites/
# Add module to the do_not_update array for prevent to update.
#declare -a do_not_update=()
#declare -a do_not_update=("parso" "asgiref")
declare -a do_not_update=("@squoosh/cli")
#########################################
: <<'END_COMMENT'
@@ -41,9 +46,12 @@ underline="\033[4m"
ita_under="\033[3;4m"
bgd="\033[1;4;31m"
red="\033[1;31m"
green="\033[1;32m"
bold="\033[1m"
bold_ita="\033[1;3m"
box="\033[1;41m"
redbold="\033[1;31m"
redbox="\033[1;41m"
reset="\033[0m"
upd_nvm() {(
@@ -71,10 +79,19 @@ echo -e " - install path: ${italic}$node_ins${reset}"
# version courante de npm
npm_v=$(npm -v)
npm_ins=$(which npm)
old_npm="$npm_v"
echo -e "\n${underline}🌿 npm:${reset}"
echo -e " - current version: ${italic}$npm_v${reset}"
echo -e " - install path: ${italic}$npm_ins${reset}"
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
# version installée de nvm par Homebrew
# nvm_installed=$(brew info nvm | grep Cellar)
@@ -142,6 +159,19 @@ echo -e "You need to run \"nvm install 10.18.0\" to install it before using it.$
echo ""
# Do not update packages
if (( ${#do_not_update[@]} )); then
nbp=${#do_not_update[*]}
echo -e "${underline}🌿 List of${reset} ${redbox} $nbp ${reset} ${underline}'do not update' packages:${reset}"
echo -e "${redbold}${do_not_update[*]}${reset}"
echo -e "To remove package from this list, you need to edit the ${italic}do_not_update${reset} array."
echo ""
fi
##################
# Local packages #
##################
@@ -203,21 +233,27 @@ if find "$local_path/node_modules" -mindepth 1 -maxdepth 1 | read; then
j=$(echo "$current" | awk -F "." '{print $1}')
k=$(echo "$latest" | awk -F "." '{print $1}')
# Update major version 1.x.y to 2.x.y
if [ $current = $wanted ] && [ "$j" -lt "$k" ]; then
if [ "$no_distract" = false ]; then
echo "$package@latest" | xargs -p npm install
if [[ ! " ${do_not_update[@]} " =~ " ${package} " ]]; then
# Update major version 1.x.y to 2.x.y
if [ $current = $wanted ] && [ "$j" -lt "$k" ]; then
if [ "$no_distract" = false ]; then
echo "$package@latest" | xargs -p npm install
else
echo "$package@latest" | xargs npm install
#npm install "$package@latest"
fi
# Update minor or patch version
else
echo "$package@latest" | xargs npm install
#npm install "$package@latest"
fi
# Update minor or patch version
else
if [ "$no_distract" = false ]; then
echo "$package" | xargs -p npm update
else
echo "$package" | xargs npm update
if [ "$no_distract" = false ]; then
echo "$package" | xargs -p npm update
else
echo "$package" | xargs npm update
fi
fi
else
echo -e "${redbold}$package is pinned to version $current !${reset} Don't update !"
fi
done <<< "$outdated"
@@ -287,20 +323,28 @@ if [ -n "$glong_outdated" ]; then
while IFS= read -r line
do
pkg=$(echo "$line" | awk '{print $1}')
curr=$(echo "$line" | awk '{print $2}')
vers=$(echo "$line" | awk '{print $4}')
outdated="$pkg@$vers"
# TEST
#version=$(echo "$line" | awk '{print $1 "@" $4}')
#echo "$version"
# /test
if [ "$no_distract" = false ]; then
echo "$outdated" | xargs -p -n 1 npm --location=global install
echo ""
if [[ ! " ${do_not_update[@]} " =~ " ${pkg} " ]]; then
# TEST
#version=$(echo "$line" | awk '{print $1 "@" $4}')
#echo "$version"
# /test
if [ "$no_distract" = false ]; then
echo "$outdated" | xargs -p -n 1 npm --location=global install
echo ""
else
echo "$outdated" | xargs -n 1 npm --location=global install
echo ""
fi
else
echo "$outdated" | xargs -n 1 npm --location=global install
echo ""
echo -e "${redbold}$pkg is pinned to version $curr !${reset} Don't update !"
fi
done <<< "$glong_outdated"
@@ -318,58 +362,65 @@ echo ""
if [ "$doctor" = true ]; then
echo -e "${underline}🌿 The Doc is checking that everything is ok.${reset}\n"
#npm doctor
#doc=$(npm doctor)
doc=$(cd "$local_path" && npm doctor)
while IFS= read -r line
do
if [[ "${line}" =~ "not ok" ]]; then
if [[ "${line}" =~ "Not ok" ]]; then
echo -e "${red}${line}${reset}"
elif [[ "${line}" =~ "Ok" ]]; then
echo -e "${green}${line}${reset}"
else
echo -e "${line}"
fi
done <<< "$doc"
#echo -e "$doc\n"
# search not ok => red
npm_v=$(echo "$doc" | grep 'npm -v')
node_v=$(echo "$doc" | grep 'node -v')
if [[ " $node_v " =~ " not ok " ]]; then
no=$(grep -o -E "v([0-9]{1,2}\.){2}[0-9]{1,2}" <<< "$node_v")
new_node=$(echo "${no:1}" | sed -n '1p')
old_node=$(echo "${no:1}" | sed -n '$p')
#npm_v=$(echo "$doc" | grep 'npm -v')
#node_v=$(echo "$doc" | grep 'node -v')
npm_v=$(echo "$doc" | grep -A2 'Checking npm version')
node_v=$(echo "$doc" | grep -A2 'Checking node version')
#if [ "$new_node" != "$old_node" ]; then
if [[ " $node_v " =~ "Not ok" ]]; then
no=$(echo "$node_v" | sed -n '$p')
new_node=$(echo "$no" | awk '{print $3}' | sed 's/^.//')
old_node=$(echo "$no" | awk '{print $5}' | sed 's/.//;s/.$//')
if [ "$new_node" != "$old_node" ] && [ "$update_node" = true ]; then
#if [ "$update_node" = true ]; then
b=$(echo -e "\nCurrent node: $old_node. Update ${bold}node${reset} to ${bold}$new_node${reset} [y/n] ? ")
b=$(echo -e "\nCurrent node: v$old_node. Update ${bold}node${reset} to ${bold}v$new_node${reset} [y/n] ? ")
read -e -p "$b" rep2
if [ "$rep2" == "y" ] || [ "$rep2" == "Y" ]; then
. $HOME/.nvm/nvm.sh
echo -e "\n${bold}Updating node to v$new_node...${reset}"
nvm install $new_node
nvm install "$new_node"
echo -e "\n${bold}Updating npm...${reset}"
npm --location=global install npm
#
nvm use $new_node
echo -e "\n${bold}Reinstall packages from $old_node...${reset}"
nvm reinstall-packages $old_node
echo -e "\n${bold}Reinstall packages from v$old_node...${reset}"
nvm reinstall-packages "$old_node"
fi
fi
fi
if [[ " $npm_v " =~ " not ok " ]]; then
if [[ " $npm_v " =~ "Not ok" ]]; then
np=$(grep -o -E "v([0-9]{1,2}\.){2}[0-9]{1,2}" <<< "$npm_v")
new_npm=$(echo "${np:1}" | sed -n '1p')
old_npm=$(echo "${np:1}" | sed -n '$p')
new_npm=$(echo "${np:1}") # 10.7.0
if [ "$new_npm" != "$old_npm" ]; then
echo -e "${underline}Udpate available for npm.${reset} You should run:"
echo -e " - ${bold}npm --location=global install npm${reset}"
echo -e "${underline}\nUdpate available for npm.${reset}"
echo -e " - Current: ${red}v$old_npm${reset}"
echo -e " - Update: ${green}v$new_npm${reset}"
echo -e "You should run:"
echo -e " - ${bold}npm --location=global install npm${reset}"
fi
fi

View File

@@ -79,8 +79,8 @@ version=$(php --info | grep 'PHP Version' | sed -n '1p' | awk -F" " '{print $NF}
v=${version:0:3}
echo -e "${ita_under}${blue}Current PHP version:${reset} ${bold}$version${reset}\n"
latest="8.0"
versions=("7.2" "7.3" "7.4" "8.1" "$latest")
latest="8.2"
versions=("7.4" "8.0" "8.1" "8.3" "$latest")
php_installed=$(ls -1 $(brew --prefix)/opt/ | grep php@)
echo -e "${ita_under}${blue}Installed PHP versions:${reset}"
echo -e "$php_installed\n"
@@ -94,6 +94,12 @@ fi
pecl version
curl -Is https://www.apple.com | head -1 | grep 200
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
# Note that all public channels can be synced using "update-channels"
echo -e "\n${ita_under}${blue}Updating all channels...${reset}"

View File

@@ -16,6 +16,20 @@ display_info=true
# Also add module for prevent to update it.
declare -a do_not_update=('')
italic="\033[3m"
underline="\033[4m"
ita_under="\033[3;4m"
bgd="\033[1;4;31m"
red="\033[1;31m"
bold="\033[1m"
bold_ita="\033[1;3m"
box="\033[1;41m"
redbold="\033[1;31m"
redbox="\033[1;41m"
reset="\033[0m"
echo -e "${bold}🐪 Perl ${reset}"
echo
perl_app=$(which perl)
perl_v=$(perl -v | sed -n '2p')
@@ -42,10 +56,17 @@ else
install_ok=true
fi
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
if [ "$install_ok" == "true" ]; then
echo "$module installed"
# install with cpan
# install with cpan
# % cpan-outdated | xargs cpan -i
# install with cpanm

View File

@@ -33,7 +33,7 @@ user=""
# Add module to the do_not_update array for prevent to update.
#declare -a do_not_update=()
#declare -a do_not_update=("parso" "asgiref")
declare -a do_not_update=("charset-normalizer")
declare -a do_not_update=("pyee")
#
#########################################
@@ -78,6 +78,13 @@ if (( ${#do_not_update[@]} )); then
fi
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
#Packages update
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
@@ -123,13 +130,15 @@ if [ -n "$upd" ]; then
# on filtre les lignes (y = asgiref|setuptools|lunr)
y=$(echo "$z" | sed 's/.$//' | sed 's/ /|/g')
dependencies=$(echo "$x" | xargs pipdeptree -r -p | grep -E $y)
dependencies=$(echo "$x" | xargs pipdeptree -r --python /opt/homebrew/opt/python@3.11/bin/python3.11 -p | grep -E $y)
echo -e ""
while IFS= read -r line; do
z=$(echo "${line}" | grep -i ^[a-z])
k=$(echo "${line}" | awk -F'==' '{print $1}')
l=$(echo "${line}" | awk -F':' '{print $2}')
k=$(echo "${line}" | awk -F'==' '{print $1}')
l=$(echo "${line}" | awk -F':' '{print $2}')
# Si la ligne commence par une lettre (aka. paquet à mettre à jour)
if [ -n "$z" ] ; then

View File

@@ -36,10 +36,17 @@ then
exit
fi
list=$(pipx list --include-injected)
list=$(pipx list --include-injected) # pipx list --quiet
echo -e "\n${underline}List installed packages:${reset}"
echo "$list"
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
pipx-outdated() {
echo -e "\n${underline}Outdated Packages:${reset}"
while read -sr pyPkgName pyPkyVersion; do

92
plugins.d/python_668.sh Executable file
View File

@@ -0,0 +1,92 @@
#!/usr/bin/env bash
# pip plugin for KYMSU
# https://github.com/welcoMattic/kymsu
# upgrade pip:
# python -m pip install --upgrade pip
# Configurer pip3:
# pip config edit
#########################################
#
# Settings:
# Display info on updated pakages / casks
#[[ $@ =~ "--info" ]] && display_info=false || display_info=true
display_info=true
# No distract mode (no user interaction)
[[ $@ =~ "-nodistract" || $@ =~ "-n" ]] && no_distract=true || no_distract=false
# Display dependancies on updated pakages / casks
#[[ $@ =~ "--depend" ]] && display_depend=false || display_depend=true
display_depend=true
#version: pip ou pip3
# pip: python3.8 - pip3: python3.9
pip_version=pip3
#user: "" or "--user"
user=""
# Add module to the do_not_update array for prevent to update.
#declare -a do_not_update=()
#declare -a do_not_update=("parso" "asgiref")
declare -a do_not_update=("pyee")
#
#########################################
: <<'END_COMMENT'
blabla
END_COMMENT
italic="\033[3m"
underline="\033[4m"
ita_under="\033[3;4m"
bold="\033[1m"
bold_under="\033[1;4m"
redbox="\033[1;41m"
redbold="\033[1;31m"
red="\033[31m"
yellow="\033[33m"
reset="\033[0m"
command -v pipdeptree >/dev/null 2>&1 || { echo -e "You shoud intall ${bold}pipdeptree${reset} for checking packages dependancies ${italic}($pip_version install pipdeptree)${reset}.\n"; }
command -v $pip_version >/dev/null 2>&1 || { echo -e "${bold}$pip_version${reset} is not installed." && exit 1; }
echo -e "${bold}🐍 $pip_version (Python 3) ${reset}"
echo ""
echo -e "Current ${underline}Python3${reset} version: $(python3 -V | awk '{print $2}')"
echo -e "Current ${underline}pip3${reset} version: $(pip3 -V)"
#$pip_version install --upgrade pip > /dev/null
echo ""
# Do not update packages
if (( ${#do_not_update[@]} )); then
nbp=${#do_not_update[*]}
echo -e "${underline}List of${reset} ${redbox} $nbp ${reset} ${underline}'do not update' packages:${reset}"
echo -e "${redbold}${do_not_update[*]}${reset}"
echo -e "To remove package from this list, you need to edit the ${italic}do_not_update${reset} array."
echo ""
fi
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
#Packages update
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
pip_outdated=$($pip_version list --outdated --format columns)
upd=$(echo "$pip_outdated" | sed '1,2d' | awk '{print $1}')

50
plugins.d/rustup.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
italic="\033[3m"
underline="\033[4m"
ita_under="\033[3;4m"
bgd="\033[1;4;31m"
red="\033[1;31m"
bold="\033[1m"
box="\033[1;41m"
reset="\033[0m"
echo -e "\n${bold}🦀 Rust${reset}\n"
curl -Is https://www.apple.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
if hash rustup 2>/dev/null; then
echo -e "🦀 ${underline}rustup check${reset}\n"
rustup check
if [[ ! $(which rustup-init) =~ "homebrew" ]]; then
echo -e "\n🦀 ${underline}Upgrading rustup itself !${reset}\n"
rustup self update
fi
echo -e "\n🦀 ${underline}Upgrading rust toolchains !${reset}\n"
rustup update
echo ""
fi
if hash cargo 2>/dev/null; then
echo -e "\n🦀 ${underline}Update cargo packages !${reset}\n"
if hash ggrep 2>/dev/null; then
cargo install $(cargo install --list | ggrep -E '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ')
else
cargo install $(cargo install --list | egrep '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ')
fi
echo ""
fi
echo ""

View File

@@ -18,7 +18,7 @@ reset="\033[0m"
# Liste des apps:
# - le venv doit avoir le même nom que l'app
declare -a apps=("soco-cli" "mkdocs")
declare -a apps=("mkdocs")
# Liste des extensions pour Mkdocs
mkdocs_ext=("mkdocs-material" "mkdocs-material-extensions" "mkdocs-git-revision-date-localized-plugin" "mkdocs-minify-plugin" "fontawesome_markdown" "mkdocs-pdf-export-plugin")
@@ -40,8 +40,16 @@ elif [[ "$OSTYPE" == "linux_gnu" ]]; then
elif [[ "$OSTYPE" == "linux_gnueabihf" ]]; then
v=$HOME/venv
fi
#
###############################################################################################
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\n${red}No Internet connection !${reset}"
echo -e "Exit !"
exit 1
fi
echo -e "Venv directory: $v\n"
################################################################################################
for app in ${apps[*]}
do