5 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
10 changed files with 166 additions and 51 deletions

View File

@@ -152,7 +152,7 @@ get_info_pkg() {
echo -e "${bold}🍺 Homebrew ${reset}"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"
@@ -504,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

View File

@@ -24,7 +24,7 @@ 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
@@ -46,6 +46,7 @@ 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"
@@ -78,12 +79,13 @@ 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 http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"
@@ -360,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

@@ -94,7 +94,7 @@ fi
pecl version
curl -Is http://www.google.com | head -1 | grep 200
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 !"

View File

@@ -57,7 +57,7 @@ else
fi
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"

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=("geomet")
declare -a do_not_update=("pyee")
#
#########################################
@@ -78,7 +78,7 @@ if (( ${#do_not_update[@]} )); then
fi
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"
@@ -130,7 +130,7 @@ 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 ""

View File

@@ -40,7 +40,7 @@ list=$(pipx list --include-injected) # pipx list --quiet
echo -e "\n${underline}List installed packages:${reset}"
echo "$list"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"

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}')

View File

@@ -11,7 +11,7 @@ reset="\033[0m"
echo -e "\n${bold}🦀 Rust${reset}\n"
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
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 !"

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" "streamrip")
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")
@@ -48,6 +48,7 @@ if [[ $? -eq 1 ]]; then
exit 1
fi
echo -e "Venv directory: $v\n"
################################################################################################
for app in ${apps[*]}