16 Commits
v1.0 ... v1.2

Author SHA1 Message Date
6e8361312c Bugfix
-pecl refonctionne
-ajout d’espace pour antibody
2020-09-02 18:25:56 +02:00
a434e2814a pip.sh
-remplacement de la variable $version par $pip_version

Nouveau:
-ajout de la commande ‘pip check’
-notice sur les nouvelles options ‘2020-resolver’ et ‘fast-deps’ (pas de changement dans le script mais ajout des options dans ‘pip config edit’)
2020-08-05 09:17:23 +02:00
0077eaca53 Antibody.sh
Nouveau:
-affiche le dossiers où s’installent les modulent
2020-08-05 09:12:16 +02:00
81afb2846e Nouveau module Antibody
Antibody est un gestionnaire de plugin pour zsh:
https://getantibody.github.io

La commande ‘antibody update’  recherche les m-à-j ET les installe.
2020-08-05 09:10:58 +02:00
285b991b09 Plugin Antibody
Antibody est un gestionnaire de module pour zsh
2020-07-24 08:00:38 +02:00
3651ee64be channel "pecl.php.net"
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
2020-06-05 08:13:58 +02:00
3eeff4b705 npm.sh
--no-colors options:
nvm list —no-colors
2020-04-18 07:20:15 +02:00
4620ab071d homebrew.sh
bugfix: ne pas tester la modif des php.ini si il n’y a pas eu de mises-à-jouir
2020-03-17 14:24:03 +01:00
78f4158361 npm.sh
Feature: update nvm from github.com
2020-01-27 18:20:10 +01:00
e5ae3745f7 README.md
-add bash 5 requirement for associative array
2020-01-26 12:24:40 +01:00
1648fbb13e homebrew.sh
-update package (yes/no/ALL)
2020-01-26 09:42:57 +01:00
80e905ec4e Cleaning code 2020-01-25 06:40:56 +01:00
3f61fa4a57 Cleaning code 2020-01-25 06:40:30 +01:00
648bd9d211 homebrew.sh
-bugfix si aucune màj de paquet n’est dispo
2019-12-20 08:43:32 +01:00
be093d2455 Minor bugfix
-temps de modification de php.ini ramené à 5mn
2019-12-10 12:38:51 +01:00
cf760c8b3a Minors bugfixs
-running hellcheck
-optimize md file
2019-12-09 19:53:21 +01:00
8 changed files with 385 additions and 152 deletions

View File

@@ -30,6 +30,7 @@ Optionnal:
- [pipdeptree](https://pypi.python.org/pypi/pipdeptree) *(pip install pipdeptree)* for checking dependancies (pip plugin)
- [jq](https://github.com/stedolan/jq) *(brew install jq)* for processing JSON data (homebrew plugin)
- [terminal-notifier](https://github.com/julienXX/terminal-notifier) *(brew install terminal-notifier)* for sending macOS notification (all plugins)
- [Bash 5](https://www.gnu.org/software/bash/) *(brew install bash)* for associative array (homebrew plugin)

123
plugins.d/antibody.sh Executable file
View File

@@ -0,0 +1,123 @@
#!/usr/bin/env bash
# Antibody plugin for KYMSU
# https://github.com/welcoMattic/kymsu
# https://github.com/getantibody/antibody
###############################################################################################
#
# Settings:
# Display info on updated pakages
display_info=true
# Casks don't have pinned cask. So add Cask to the do_not_update array for prevent to update.
# Also add package for prevent to update whitout pin it.
declare -a do_not_update=('')
# No distract mode (no user interaction)(Casks with 'latest' version number won't be updated)
no_distract=false
#
###############################################################################################
#
# Recommended software (brew install):
# -jq (Lightweight and flexible command-line JSON processor)
# -terminal-notifier (Send macOS User Notifications from the command-line)
#
###############################################################################################
notification() {
sound="Basso"
title="Antibody"
#subtitle="Attention !!!"
message="$1"
image_err="error.png"
image_ok="success.png"
if [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v terminal-notifiera)" ]; then
terminal-notifier -title "$title" -message "$message" -sound "$sound" -contentImage "$image_ok"
elif [[ "$OSTYPE" == "darwin"* ]] && [ -n "$(which alerter)" ]; then
alerter -title "$title" -subtitle "" -message "$message" -sound "$sound" -contentImage "$image_ok" -timeout 3
fi
}
if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
echo -e "\033[1m🙏 Antibody \033[0m"
echo ""
antibody_folder=$(antibody home)
update=$(antibody update 2>&1)
installed=$(echo "$update" | grep "updating")
updated=$(echo "$update" | grep "updated")
if [ -n "$installed" ]; then
echo -e "\033[4mAntibody modules installed:\033[0m"
#echo "$installed"
IFS=$'\n'
#for i in $(echo "$update" | grep "updating")
for i in $(echo "$installed")
do
url=$(echo "$i" | awk '{print $3}')
module=$(echo "$i" | awk -F "/" '{print $NF}')
echo -e "\033[1m$module\033[0m ($url)"
done
echo ""
echo "Modules are installed in $antibody_folder folder."
else
echo -e "\033[4mNo Antibody modules installed.\033[0m"
fi
<<COMMENT
antibody: updating: https://github.com/zsh-users/zsh-history-substring-search
antibody: updating: https://github.com/zsh-users/zsh-completions
antibody: updating: https://github.com/zsh-users/zsh-autosuggestions
antibody: updating: https://github.com/mafredri/zsh-async
antibody: updating: https://github.com/zdharma/fast-syntax-highlighting
antibody: updating: https://github.com/sindresorhus/pure
antibody: updating: https://github.com/marzocchi/zsh-notify
COMMENT
echo ""
if [ -n "$updated" ]; then
echo -e "\033[4mAntibody modules to update:\033[0m"
#echo "$updated"
IFS=$'\n'
for j in $(echo "$updated")
do
url=$(echo "$j" | awk '{print $3}')
module=$(echo "$j" | awk -F "/" '{print $NF}' | awk '{print $1}')
commit=$(echo "$j" | awk -F "$url" '{print $NF}')
last_commit=$(echo "$commit" | awk '{print $NF}')
echo -e "\033[1m$module\033[0m ($url)"
echo "Commits: $commit"
echo "Last commit: "$url"/commits/"$last_commit
# https://github.com/zsh-users/zsh-completions/commits/
notif="$module has been updated"
notification "$notif"
done
else
echo -e "\033[4mNo Antibody modules to update.\033[0m"
echo ""
fi
<<COMMENT
antibody: updated: https://github.com/mafredri/zsh-async 95c2b15 -> 490167c
antibody: updated: https://github.com/marzocchi/zsh-notify 4eea098 -> 8a4abe7
antibody: updated: https://github.com/sindresorhus/pure 0a92b02 -> 3a5355b
antibody: updated: https://github.com/zdharma/fast-syntax-highlighting 303eeee -> 865566c
antibody: updated: https://github.com/zsh-users/zsh-completions ed0c7a7 -> 16b8947
COMMENT
echo ""
echo ""

View File

@@ -73,7 +73,7 @@ fi
# A pinned package is in 'brew outdated'
declare -A array_info
declare -A array_info # bash 5
if [ -x "$(command -v jq)" ]; then
brew_outdated=$(brew outdated --json)
@@ -86,6 +86,8 @@ if [ -x "$(command -v jq)" ]; then
done
upd3=$(echo "$upd3" | sed 's/.$//')
#echo "upd3:$upd3:"
if [ -n "$upd3" ]; then
# Only 1 request 'brew info' for all updated packages
info=$(brew info --json=v1 $upd3)
@@ -111,11 +113,12 @@ if [ -x "$(command -v jq)" ]; then
done
nb=$i
i=0
fi
else
brew_outdated=$(brew outdated)
upd3=$(echo "$brew_outdated" | awk '{print $1}')
if [ -n "$upd3" ]; then
info=$(brew info $upd3)
for i in $upd3
do
@@ -124,6 +127,7 @@ else
done
nb=${#array_info[@]}
fi
fi
# Get infos for all updated packages
@@ -216,7 +220,8 @@ if [ -n "$upd3" ]; then
if [ -n "$not_pinned" ]; then
a=$(echo -e "Do you wanna run \033[1mbrew upgrade "$not_pinned"\033[0m ? (y/n)")
a=$(echo -e "Do you wanna run \033[1mbrew upgrade "$not_pinned"\033[0m ? (y/n/a)")
# yes/no/all
read -p "$a" choice
#case "$choice" in
# y|Y ) echo "$brew_outdated" | awk '{print $1}' | xargs -p -n 1 brew upgrade ;;
@@ -224,38 +229,40 @@ if [ -n "$upd3" ]; then
# * ) echo "invalid";;
#esac
if [ "$choice" == "y" ]; then
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
for i in $not_pinned
do
FOUND=`echo ${do_not_update[*]} | grep "$i"`
if [ "${FOUND}" = "" ]; then
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo "$i" | awk '{print $1}' | xargs -p -n 1 brew upgrade
#echo "Running update package $i "
#fi
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
echo "$i" | awk '{print $1}' | xargs -n 1 brew upgrade
fi
fi
done
else
echo "Ok, let's continue"
fi
else
echo "No package to update"
fi
else # no distract = true
if [ -n "$not_pinned" ]; then
echo "$not_pinned" | awk '{print $1}' | xargs -n 1 brew upgrade
#echo "Running update package $not_pinned"
else
echo "No package to update"
fi
fi
echo ""
else
echo -e "\033[4mNo package to update.\033[0m"
fi
echo ""
# Casks
echo "🍺 Casks upgrade."
@@ -295,7 +302,6 @@ if [ -n "$latest" ] && [ "$no_distract" = false ]; then
for i in "$latest"
do
echo "$i" | awk '{print $1}' | xargs -p -n 1 brew cask upgrade --greedy
echo $?
done
else
echo "Ok, let's continue"
@@ -313,6 +319,9 @@ name=$(basename $conf_apa)
notif1="$dir has been modified in the last 5 minutes"
test=$(find $dir -name "$name" -mmin -5 -maxdepth 1)
echo "$test"
[ ! -z $test ] && echo -e "\033[1;31m❗ $notif1\033[0m"
[ ! -z $test ] && notification "$notif1"
@@ -321,16 +330,21 @@ test=$(find $dir -name "$name" -mmin -5 -maxdepth 1)
php_versions=$(ls /usr/local/etc/php/)
for php in $php_versions
do
if [ -n "$upd3" ]; then
# file modified since it was last read
#if [ -N /usr/local/etc/php/$php/php.ini ]; then echo "modified"; fi
php_modified=$(find /usr/local/etc/php/$php/ -name php.ini -newer /tmp/checkpoint)
php_ini=/usr/local/etc/php/$php/php.ini
notif2="$php_ini has been modified"
echo "$php_modified"
[ ! -z $php_modified ] && echo -e "\033[1;31m❗ $notif2\033[0m"
[ ! -z $php_modified ] && notification "$notif2"
fi
done
echo ""
@@ -349,6 +363,9 @@ if [[ $1 == "--cleanup" ]]; then
echo "🍺 Cleaning brewery"
##brew cleanup -s
# keep 30 days
#HOMEBREW_NO_INSTALL_CLEANUP
brew cleanup --prune=30
##brew cask cleanup: deprecated - merged with brew cleanup
#brew cask cleanup --outdated

View File

@@ -10,14 +10,13 @@
local_path=/Users/bruno/Sites/node_modules/
chemin=$(pwd)
#version: pip ou pip3
version=pip3
pip_version=pip3
#
#########################################
now=$(date +"%d-%m-%Y_%T")
mac=$(hostname -s)
file=$mac"@"$now
#echo "$file"
filename="Installed_$file"
echo -e "\033[1m🛠 Installed \033[0m"
@@ -33,57 +32,67 @@ fi
if [ -f Brewfile ]; then
echo -e "The \033[93mBrewfile\033[0m already exist! We rename it."
bf=$(find . -name 'Brewfile_*' -maxdepth 1 | xargs rm)
d=$(date -r Brewfile "+%m-%d-%Y_%H:%M:%S")
find . -name 'Brewfile_*' -maxdepth 1 -print0 | xargs rm
d=$(date -r Brewfile "+%d-%m-%Y_%H:%M:%S")
mv Brewfile "Brewfile_$mac@$d"
fi
echo '# Apps, package, scripts installed:' > Installed.md
echo "<u>"$mac"@"$now"</u>" >> Installed.md
echo '' >> Installed.md
{
echo '# Apps, package, scripts installed:'
echo "*$mac@$now*"
echo ''
echo '[TOC]' >> Installed.md
echo '' >> Installed.md
echo '[TOC]'
echo ''
# Homebrew
echo '## Homebrew' >> Installed.md
echo '' >> Installed.md
echo '## 🍺 Homebrew'
echo ''
} >> Installed.md
echo -e "🍺 Get Homebrew \033[3m\033[93mtap\033[0m list"
echo '### Tap:' >> Installed.md
tap=$(brew tap)
echo "\`\`\`bash" >> Installed.md
echo "$tap" >> Installed.md
echo "\`\`\`" >> Installed.md
echo "" >> Installed.md
{
echo "\`\`\`bash"
echo "$tap"
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
echo '### Packages:' >> Installed.md
brew=$(brew list)
echo "\`\`\`bash" >> Installed.md
echo "$brew" >> Installed.md
echo "\`\`\`" >> Installed.md
echo "" >> Installed.md
{
echo "\`\`\`bash"
echo "$brew"
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
echo -e "🍺 Get Homebrew \033[3m\033[93mCask\033[0m installed list"
echo '### Casks:' >> Installed.md
cask=$(brew cask list)
echo "\`\`\`bash" >> Installed.md
echo "$cask" >> Installed.md
echo "\`\`\`" >> Installed.md
echo "" >> Installed.md
{
echo "\`\`\`bash"
echo "$cask"
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
# liste des apps de l'Appstore installées (nom & numéro)
echo -e "🍏 Get mas \033[3m\033[93mApp Store applications\033[0m list"
echo '## mas (Mac App Store)' >> Installed.md
echo '## 🍏 mas (Mac App Store)' >> Installed.md
echo '' >> Installed.md
appfrommas=$(mas list | sort -k2)
@@ -93,91 +102,104 @@ echo "\`\`\`bash" >> Installed.md
# todo: trier la liste par nom
while read -r line; do
number=$(echo "$line" | awk '{print $1}')
name=$(echo "$line" | awk -F "(" '{print $1}' | awk {'first = $1; $1=""; print $0'} | sed 's/^ //g')
#name=$(echo "$line" | awk -F "(" '{print $1}' | awk {'first = $1; $1=""; print $0'} | sed 's/^ //g')
name=$(echo "$line" | awk -F "(" '{print $1}' | awk '{first = $1; $1=""; print $0}' | sed 's/^ //g')
echo "$name ($number)" >> Installed.md
#echo " " >> Installed.md
#appstore["$name"]="${number}"
done <<< "$appfrommas"
echo "\`\`\`" >> Installed.md
echo "" >> Installed.md
{
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
# Extensions PHP PECL
echo -e "🐘 Get PECL \033[3m\033[93mPHP extensions\033[0m list"
echo '## PECL extensions' >> Installed.md
echo '## 🐘 PECL extensions' >> Installed.md
echo '' >> Installed.md
ext_pecl=$(pecl list | sed '1,3d' | awk '{print $1}')
echo "\`\`\`bash" >> Installed.md
echo "$ext_pecl" >> Installed.md
echo "\`\`\`" >> Installed.md
echo "" >> Installed.md
{
echo "\`\`\`bash"
echo "$ext_pecl"
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
# Python packages (pip)
echo -e "🐍 Get pip \033[3m\033[93mPython 3 packages\033[0m installed list"
echo '## Python packages' >> Installed.md
echo '' >> Installed.md
pip_packages=$($version list | sed '1,2d' | awk '{print $1}')
echo "\`\`\`bash" >> Installed.md
echo "$pip_packages" >> Installed.md
echo "\`\`\`" >> Installed.md
echo '## 🐍 Python packages' >> Installed.md
echo '' >> Installed.md
pip_packages=$($pip_version list | sed '1,2d' | awk '{print $1}')
{
echo "\`\`\`bash"
echo "$pip_packages"
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
# atom
echo -e "⚛️ Get \033[3m\033[93mAtom editor packages\033[0m installed list"
echo '## Atom packages' >> Installed.md
echo '' >> Installed.md
atom=$(apm list | grep 'Community Packages' -A 100 | sed '1,1d')
{
echo '## ⚛️ Atom packages'
echo ''
echo "\`\`\`bash"
echo "\`\`\`bash" >> Installed.md
while read -r line; do
a=$(echo "$line" | awk -F "@" '{print $1}' | awk '{print $2}' )
#atom_pkg=${a:4}
echo "$a" >> Installed.md
echo "$a"
done <<< "$atom"
echo "\`\`\`" >> Installed.md
echo '' >> Installed.md
echo "\`\`\`"
echo ""
echo ''
} >> Installed.md
# Node.js packages (npm)
echo '## Node.js packages' >> Installed.md
echo '' >> Installed.md
echo -e "🌿 Get npm \033[3m\033[93m node global packages\033[0m installed scripts"
echo '### Global:' >> Installed.md
pkg_global_npm=$(npm list -g --depth=0 --silent | sed '1d' | awk '{print $2}' | awk -F "@" '{print $1}')
pkg_global_npm=$(npm list -g --depth=0 --silent | sed '1,2d' | awk '{print $2}' | awk -F "@" '{print $1}')
echo "\`\`\`bash" >> Installed.md
echo "$pkg_global_npm" >> Installed.md
echo "\`\`\`" >> Installed.md
{
echo '## 🌿 Node.js packages'
echo ''
echo '### Global:'
echo "\`\`\`bash"
echo "$pkg_global_npm"
echo "\`\`\`"
} >> Installed.md
#echo "$local_path"
if [ -d "$local_path" ]; then
cd $local_path
cd "$local_path" || exit
echo -e "🌿 Get npm \033[3m\033[93m node local packages\033[0m installed scripts"
echo '### Local:' >> "$chemin/Installed.md"
pkg_local=$(npm ls | sed '1,1d' | grep -v 'deduped')
pkg_local=$(npm ls | sed '1d' | grep -v 'deduped')
echo "\`\`\`bash" >> "$chemin/Installed.md"
{
echo "\`\`\`bash"
while read -r line; do
a=$(echo "$line" | awk -F "@" '{print $1}')
pkg_local_npm=${a:4}
echo "$pkg_local_npm" >> "$chemin/Installed.md"
pkg_local_npm=$(echo "$line" | sed 's/[│ └──├┬]//g' | awk -F "@" '{print $1}')
echo "$pkg_local_npm"
done <<< "$pkg_local"
echo "\`\`\`" >> "$chemin/Installed.md"
echo "\`\`\`"
} >> "$chemin/Installed.md"
cd $chemin
cd "$chemin" || exit
fi
echo "" >> Installed.md
@@ -193,9 +215,10 @@ 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 ''
iconv -f macroman -t utf-8 Installed.md > Installed-utf8.md
#iconv -s -f macroman -t utf-8 Installed.md
mv Installed-utf8.md "$filename".md
rm Installed.md
#iconv -f macroman -t utf-8 Installed.md > Installed-utf8.md
#mv Installed-utf8.md "$filename".md
#rm Installed.md
mv Installed.md "$filename".md
open "$filename".md

View File

@@ -12,6 +12,7 @@ if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
# https://github.com/mas-cli/mas
# On teste si mas est installé
if hash mas 2>/dev/null; then
@@ -19,8 +20,7 @@ if hash mas 2>/dev/null; then
echo ""
echo "$massy"
#if [ -n "$massy" ]; then
if [ ! -z "$(mas outdated)" ]; then
if [ -n "$(mas outdated)" ]; then
echo -e "\033[4mAvailables updates:\033[0m"
echo "$massy" | cut -d " " -f2-5
echo ""
@@ -28,7 +28,7 @@ if hash mas 2>/dev/null; then
if [ "$no_distract" = false ]; then
a=$(echo -e "Do you wanna run \033[1mmas upgrade\033[0m ? (y/n)")
read -p "$a" choice
read -pr "$a" choice
case "$choice" in
y|Y|o ) mas upgrade;;
n|N ) echo "Ok, let's continue";;

View File

@@ -27,6 +27,9 @@ if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
# Set ls_color to '' for output nvm list in colors, else '--no-colors'
ls_color='--no-colors'
# Set doctor=true to run 'npm doctor' and 'npm cache verify' each time
doctor=true
@@ -46,19 +49,41 @@ echo -e "\033[4m🌿 node.js\033[0m (current version): $node_v"
npm_v=$(npm -v)
echo -e "\033[4m🌿 npm\033[0m (current version): $npm_v"
# versions installées de node.js
# version installée de nvm par Homebrew
nvm_installed=$(brew info nvm | grep Cellar)
# version actuelle de nvm sur GitHub
version_nvm=$(git ls-remote --tags --refs --sort="v:refname" git://github.com/nvm-sh/nvm.git | tail -n1 | sed 's/.*\///' | sed 's/v//')
# github
if [ -f "$NVM_DIR/nvm.sh" ]; then
source $NVM_DIR/nvm.sh
# version courante de nvm
nvm_v=$(nvm --version)
#echo "$nvm_v,$version_nvm" | tr ',' '\n' | sort -V
echo -e "\033[4m🌿 nvm install is:\033[0m $NVM_DIR/nvm.sh"
echo "nvm $nvm_v is installed from https://github.com/nvm-sh/nvm"
node_install=$(nvm list)
if [ "$nvm_v" != "$version_nvm" ]; then
echo "Current nvm version on GitHub: $version_nvm"
echo "Current nvm installed version: $nvm_v"
read -p "Do you want to update nvm from GitHub repo? (y/n)" choice
if [ "$choice" == "y" ]; then
echo "Updating nvm from GitHub..."
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v"$version_nvm"/install.sh | bash
#curl: native on Catalina, wget installed by homebrew
#wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
fi
fi
node_install=$(nvm list "$ls_color")
echo -e "\033[4m🌿 node.js\033[0m (installed versions): \n$node_install"
# homebrew
elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
source $(brew --prefix nvm)/nvm.sh
# version courante de nvm
@@ -66,16 +91,28 @@ elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
echo -e "\033[4m🌿 nvm install is:\033[0m /usr/local/opt/nvm/nvm.sh"
echo "nvm $nvm_v is installed from homebrew"
node_install=$(nvm list)
if [ "$nvm_v" != "$version_nvm" ]; then
echo "Current nvm version on GitHub: $version_nvm"
echo "Current nvm installed version: $nvm_v"
echo -e "nvm is outdated ! You should run \033[1;3mbrew update && brew upgrade nvm\033[0m"
echo -e "or run \033[1;3mKymsu's homebrew.sh script\033[0m."
fi
node_install=$(nvm list "$ls_color")
echo -e "\033[4m🌿 node.js\033[0m (installed versions): \n$node_install"
fi
echo -e "\033[3mNote:"
echo -e "N/A: version \"10.18.0 -> N/A\" is not yet installed."
echo -e "You need to run \"nvm install 10.18.0\" to install it before using it.\033[0m"
echo
# Local packages
if [ -d "$local_path" ]; then
cd $local_path
cd "$local_path" || return
echo -e "\033[4m🌿 Local installed scripts:\033[0m"
npm ls
outdated=$(npm outdated)
@@ -93,7 +130,8 @@ echo ""
echo -e "\033[4m🌿 Global installed scripts:\033[0m"
npm list -g --depth=0
g_outdated=$(npm outdated -g)
#g_outdated=$(npm outdated -g)
g_outdated=$(npm outdated -g --parseable=true)
# => npm ERR! Cannot read property 'length' of undefined -> https://stackoverflow.com/questions/55172700/npm-outdated-g-error-cannot-read-property-length-of-undefined
# /Users/bruno/.nvm/versions/node/v10.16.2/lib/node_modules/npm/lib/outdated.js
@@ -102,12 +140,17 @@ g_outdated=$(npm outdated -g)
# update -> wanted ; install -> latest
if [ -n "$g_outdated" ]; then
if [ "$no_distract" = false ]; then
echo "$g_outdated"
#echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -p -n 1 npm install -g
echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -p -n 1 npm update -g
#echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -p -n 1 npm update -g --verbose
# npm verb outdated not updating @angular/cli because it's currently at the maximum version that matches its specified semver range
echo "$g_outdated" | cut -d : -f 4 | xargs -p -n 1 npm -g install
else
#echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -n 1 npm install -g
echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -n 1 npm update -g
#echo "$g_outdated" | sed '1d' | awk '{print $1}' | xargs -n 1 npm update -g
echo "$g_outdated" | cut -d : -f 4 | xargs -n 1 npm -g install
fi
else
echo -e "\033[4mNo global packages updates.\033[0m"

View File

@@ -53,11 +53,19 @@ if [ -n "$pecl_upgrade" ]; then
if [ -n "$available" ]; then
while read ligne
do
#echo "$ligne"
echo "$ligne"
# Channel pear.php.net
a=$(echo "$ligne" | grep "pear")
if [ -n "$a" ]; then
pecl channel-update pear.php.net
else
fi
# Channel pecl.php.net
b=$(echo "$ligne" | grep "pecl")
if [ -n "$b" ]; then
pecl channel-update pecl.php.net
#(pecl or doc) update available
b=$(echo "$ligne" | awk '{print $2}')
pecl info "$b"
@@ -68,6 +76,8 @@ if [ -n "$pecl_upgrade" ]; then
echo "$b" | xargs -n 1 pecl upgrade
fi
fi
echo ""
done <<< "$available"
fi
fi
@@ -77,13 +87,13 @@ fi
# php.ini a été modifié il y a moins de 5mn
v_php=$(php --info | grep -E 'usr.*ini')
conf_php=$(echo "$v_php" | grep 'Loaded Configuration File' | awk '{print $NF}')
dir=$(dirname $conf_php)
name=$(basename $conf_php)
dir=$(dirname "$conf_php")
name=$(basename "$conf_php")
notif2="$conf_php was modified in the last 5 minutes"
test=$(find $dir -name "$name" -mmin -500 -maxdepth 1)
test=$(find "$dir" -name "$name" -mmin -5 -maxdepth 1)
if [ ! -z $test ]; then
if [ -n "$test" ]; then
echo -e "\033[1;31m❗ $notif2\033[0m"
notification "$notif2"
echo ""
@@ -91,7 +101,7 @@ if [ ! -z $test ]; then
a=$(echo -e "Do you want to edit \033[1m$conf_php\033[0m file ? (y/n)")
read -p "$a" choice
if [ "$choice" == "y" ]; then
$EDITOR $conf_php
$EDITOR "$conf_php"
fi
fi

View File

@@ -3,12 +3,19 @@
# pip plugin for KYMSU
# https://github.com/welcoMattic/kymsu
# upgrade pip:
# python -m pip install --upgrade pip
#export PIP_USE_FEATURE=2020-resolver
#export PIP_USE_FEATURE=fast-deps
# pip config edit
#########################################
#
# Settings:
#version: pip ou pip3
version=pip3
pip_version=pip3
#user: "" or "--user"
user=""
# No distract mode
@@ -22,18 +29,21 @@ if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
if ! [ -x "$(command -v $version)" ]; then
echo "Error: $version is not installed." >&2
if ! [ -x "$(command -v $pip_version)" ]; then
echo "Error: $pip_version is not installed." >&2
exit 1
fi
echo -e "\033[1m🐍 $version (Python 3) \033[0m"
echo -e "\033[1m🐍 $pip_version (Python 3) \033[0m"
echo ""
$version install --upgrade pip
echo -e "\033[31mpip use features 2020-resolver & fast-deps for testings. pip 20.3 (10/2020) pip definitively this features.\033[0m"
echo ""
$pip_version install --upgrade pip
echo ""
pip_outdated=$($version list --outdated --format columns)
pip_outdated=$($pip_version list --outdated --format columns)
upd=$(echo "$pip_outdated" | sed '1,2d' | awk '{print $1}')
if [ -n "$upd" ]; then
@@ -45,10 +55,10 @@ if [ -n "$upd" ]; then
for i in $upd
do
info=$($version show $i)
#info=$($version show $i | sed -n 4q)
#info=$($version show $i | head -5)
#info=$($version show $i | tail -n +5)
info=$($pip_version show "$i")
#info=$($pip_version show $i | sed -n 4q)
#info=$($pip_version show $i | head -5)
#info=$($pip_version show $i | tail -n +5)
echo "$info" | head -4
echo ''
#echo "$i"
@@ -80,9 +90,9 @@ if [ -n "$upd" ]; then
else
c=$(echo -e "Do you want to install pipdeptree to check dependancies ? (y/n)")
read -p "$c" choice
read -pr "$c" choice
case "$choice" in
y|Y|o ) $version install $user pipdeptree ;;
y|Y|o ) $pip_version install $user pipdeptree ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
@@ -94,10 +104,10 @@ if [ -n "$upd" ]; then
FOUND=`echo ${do_not_update[*]} | grep "$i"`
if [ "${FOUND}" = "" ] && [ "$no_distract" = false ]; then
b=$(echo -e "Do you wanna run \033[1m$version install $user --upgrade "$i"\033[0m ? (y/n)")
b=$(echo -e "Do you wanna run \033[1m$pip_version install $user --upgrade $i\033[0m ? (y/n)")
read -p "$b" choice
case "$choice" in
y|Y|o ) echo $i | xargs $version install $user --upgrade ;;
y|Y|o ) echo "$i" | xargs $pip_version install $user --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
@@ -105,7 +115,8 @@ if [ -n "$upd" ]; then
elif [ "${FOUND}" = "" ]; then
echo $i | xargs $version install $user --upgrade
echo "$i" | xargs $pip_version install $user --upgrade
#echo "$i" | xargs $pip_version install $user --use-feature=2020-resolver --upgrade
fi
done
@@ -114,5 +125,10 @@ else
echo -e "\033[4mNo availables updates.\033[0m"
fi
echo -e "🐍 Running \033[1mpip check\033[0m for checking that everything is ok."
$pip_version check
echo ""
echo ""