Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a32a0d6ded
|
|||
|
9d8b924a30
|
|||
|
a5c0c2b011
|
|||
|
1061909d5b
|
|||
|
02648b8f83
|
|||
|
e97ae7ec2c
|
|||
|
064ae0ecf0
|
|||
|
cb0a07339d
|
@@ -25,13 +25,13 @@ homebrew and pecl plugins notifie you if apache/php configuration files have bee
|
||||
## Requirements
|
||||
|
||||
- [Homebrew](https://brew.sh/)
|
||||
- [jq](https://github.com/stedolan/jq) *(brew install jq)* for processing JSON data (homebrew plugin)
|
||||
|
||||
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)
|
||||
- ~~[Bash 5](https://www.gnu.org/software/bash/) *(brew install bash)* for associative array (homebrew plugin)~~ (homebrew plugin 2.0)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ reset="\033[0m"
|
||||
KYMSU_PATH=`pwd`
|
||||
|
||||
# Make Kymsu accessible in PATH
|
||||
echo -e "Installing ${bold}kymsu2${reset} in ${bold}/usr/local/bin${reset} ..."
|
||||
echo -e "\nInstalling ${bold}kymsu2${reset} in ${bold}/usr/local/bin${reset} ..."
|
||||
ln -fs "${KYMSU_PATH}"/kymsu2.sh /usr/local/bin/kymsu2
|
||||
|
||||
# Store Kymsu stuff in home directory
|
||||
|
||||
@@ -15,8 +15,9 @@ display_info=true
|
||||
# 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
|
||||
# No distract mode (no user interaction)
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
|
||||
#
|
||||
###############################################################################################
|
||||
#
|
||||
@@ -26,6 +27,15 @@ no_distract=false
|
||||
#
|
||||
###############################################################################################
|
||||
|
||||
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"
|
||||
|
||||
notification() {
|
||||
sound="Basso"
|
||||
title="Antibody"
|
||||
@@ -42,14 +52,12 @@ notification() {
|
||||
}
|
||||
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
|
||||
echo -e "\033[1m🙏 Antibody \033[0m"
|
||||
echo ""
|
||||
|
||||
antibody_folder=$(antibody home)
|
||||
antibody_version=$(antibody -v 2>&1 | awk '{print $3}')
|
||||
|
||||
echo -e "${bold}🙏 Antibody ${reset}\n"
|
||||
|
||||
echo -e "Current ${underline}Antibody${reset} version: $antibody_version\n"
|
||||
|
||||
update=$(antibody update 2>&1)
|
||||
|
||||
@@ -57,7 +65,7 @@ installed=$(echo "$update" | grep "updating")
|
||||
updated=$(echo "$update" | grep "updated")
|
||||
|
||||
if [ -n "$installed" ]; then
|
||||
echo -e "\033[4mAntibody modules installed:\033[0m"
|
||||
echo -e "${underline}Antibody modules installed:${reset}"
|
||||
#echo "$installed"
|
||||
|
||||
IFS=$'\n'
|
||||
@@ -66,16 +74,18 @@ if [ -n "$installed" ]; then
|
||||
do
|
||||
url=$(echo "$i" | awk '{print $3}')
|
||||
module=$(echo "$i" | awk -F "/" '{print $NF}')
|
||||
echo -e "\033[1m$module\033[0m ($url)"
|
||||
echo -e "${bold}$module${reset} ($url)"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Modules are installed in $antibody_folder folder."
|
||||
else
|
||||
echo -e "\033[4mNo Antibody modules installed.\033[0m"
|
||||
echo -e "${underline}No Antibody modules installed.${reset}"
|
||||
fi
|
||||
|
||||
<<COMMENT
|
||||
antibody update:
|
||||
|
||||
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
|
||||
@@ -88,7 +98,7 @@ COMMENT
|
||||
echo ""
|
||||
|
||||
if [ -n "$updated" ]; then
|
||||
echo -e "\033[4mAntibody modules to update:\033[0m"
|
||||
echo -e "${underline}Antibody modules to update:${reset}"
|
||||
#echo "$updated"
|
||||
|
||||
IFS=$'\n'
|
||||
@@ -98,20 +108,18 @@ if [ -n "$updated" ]; then
|
||||
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 -e "${bold}$module${reset} ($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"
|
||||
modules+="$module "
|
||||
done
|
||||
notif="$modules has been updated"
|
||||
notification "$notif"
|
||||
|
||||
else
|
||||
echo -e "\033[4mNo Antibody modules to update.\033[0m"
|
||||
echo -e "${underline}No Antibody modules to update.${reset}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,13 +5,20 @@
|
||||
# https://guides.rubygems.org/what-is-a-gem/
|
||||
|
||||
# No distract mode
|
||||
no_distract=false
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
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"
|
||||
|
||||
echo -e "\033[1m 💍 Gem (Ruby) \033[0m"
|
||||
echo -e "${bold} 💍 Gem (Ruby) ${reset}"
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -21,7 +28,7 @@ upd=$(echo "$gem_outdated" | awk '{print $1}')
|
||||
if [ -n "$upd" ]; then
|
||||
nb=$(echo "$upd" | wc -w | xargs)
|
||||
|
||||
echo -e "\\033[1;41m $nb \033[0m \033[4mavailables updates:\033[0m"
|
||||
echo -e "${redbox} $nb ${reset} ${underline}availables updates:${reset}"
|
||||
echo "$gem_outdated"
|
||||
echo ""
|
||||
|
||||
@@ -38,5 +45,5 @@ if [ -n "$upd" ]; then
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo -e "\033[4mNo gem updates.\033[0m"
|
||||
echo -e "${underline}No gem updates.${reset}"
|
||||
fi
|
||||
|
||||
@@ -11,16 +11,15 @@
|
||||
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=("xnconvert" "yate")
|
||||
declare -a cask_to_not_update=()
|
||||
|
||||
# No distract mode (no user interaction)(Casks with 'latest' version number won't be updated)
|
||||
no_distract=false
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
|
||||
# Some Casks have auto_updates true or version :latest. Homebrew Cask cannot track versions of those apps.
|
||||
# 'latest=true' force Homebrew to update those apps.
|
||||
latest=true
|
||||
latest=false
|
||||
#
|
||||
###############################################################################################
|
||||
#
|
||||
@@ -60,9 +59,6 @@ notification() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then no_distract=true; fi
|
||||
if [[ $1 == "--latest" ]]; then latest=true; fi
|
||||
|
||||
get_info_cask() {
|
||||
info="$1"
|
||||
app="$2"
|
||||
@@ -205,7 +201,7 @@ echo -e "\n🍺 ${underline}Updating packages...${reset}\n"
|
||||
if [ -n "$upd_pkg_notpinned" ]; then
|
||||
|
||||
if [ "$no_distract" = false ]; then
|
||||
a=$(echo -e "Do you wanna run \033[1mbrew upgrade "$upd_pkg_notpinned"\033[0m ? (y/n/a) ")
|
||||
a=$(echo -e "Do you wanna run ${bold}brew upgrade "$upd_pkg_notpinned"${reset} ? (y/n/a) ")
|
||||
# yes/no/all
|
||||
read -p "$a" choice
|
||||
|
||||
@@ -231,6 +227,8 @@ else
|
||||
echo -e "\n${italic}No update package available...${reset}\n"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
#############
|
||||
### Casks ###
|
||||
#############
|
||||
@@ -261,9 +259,9 @@ if (( ${#cask_to_not_update[@]} )); then
|
||||
|
||||
nbp=${#cask_to_not_update[*]}
|
||||
|
||||
echo -e "${underline}List of${reset} ${box} $nbp ${reset} ${underline}'do not update' packages:${reset}"
|
||||
echo -e "${underline}List of${reset} ${box} $nbp ${reset} ${underline}'do not update' casks:${reset}"
|
||||
echo -e "${red}${cask_to_not_update[*]}${reset}"
|
||||
echo -e "To remove package from this list, you need to edit the ${italic}do_not_update${reset} array."
|
||||
echo -e "To remove an app from this list, you need to edit the ${italic}do_not_update${reset} array."
|
||||
echo ""
|
||||
|
||||
casks_not_pinned=""
|
||||
@@ -299,7 +297,7 @@ if [ "$nb_casks_upd" -gt 0 ]; then
|
||||
array=($a)
|
||||
if [ "$display_info" = true ]; then
|
||||
[ "$nb_casks_upd" -gt 1 ] && echo -e "${box} $nb_casks_upd ${reset} ${array[@]/%/s}:\n" || echo -e "${box} $nb_casks_upd ${reset} ${array[@]}:\n"
|
||||
upd_casks_info=$(brew info --json=v2 $upd_casks | jq '{casks} | .[]')
|
||||
upd_casks_info=$(brew info --cask --json=v2 $upd_casks | jq '{casks} | .[]')
|
||||
for row in $upd_casks;
|
||||
do
|
||||
get_info_cask "$upd_casks_info" "$row"
|
||||
@@ -311,7 +309,8 @@ fi
|
||||
|
||||
# Updating casks
|
||||
echo -e "\n🍺 ${underline}Updating casks...${reset}\n"
|
||||
[ -n "$casks_not_pinned" ] && echo -e "${red}Do not update: ${cask_to_not_update[@]} . It won't be updated!'${reset}\n"
|
||||
|
||||
[ "${#cask_to_not_update[@]}" -gt 0 ] && echo -e "${red}Do not update: ${cask_to_not_update[@]} . It won't be updated!'${reset}\n"
|
||||
[ -n "$casks_latest_not_pinned" ] && echo -e "Some Casks have ${italic}auto_updates true${reset} or ${italic}version :latest${reset}. Homebrew Cask cannot track versions of those apps."
|
||||
[ -n "$casks_latest_not_pinned" ] && echo -e "Edit this script and change the setting ${italic}latest=false${reset} to ${italic}true${reset}\n"
|
||||
|
||||
@@ -324,13 +323,15 @@ if [ -n "$casks_not_pinned" ]; then
|
||||
read -p "$a" choice
|
||||
|
||||
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
||||
echo ""
|
||||
for i in $casks_not_pinned;
|
||||
do
|
||||
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
|
||||
echo "$i" | xargs -p -n 1 brew upgrade
|
||||
# --cask required for Cask like 'docker'. It can be a formula or a cask.
|
||||
echo "$i" | xargs -p -n 1 brew upgrade --cask
|
||||
echo ""
|
||||
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
||||
echo "$i" | xargs -n 1 brew upgrade --dry-run
|
||||
echo "$i" | xargs -n 1 brew upgrade --cask
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
@@ -338,7 +339,7 @@ if [ -n "$casks_not_pinned" ]; then
|
||||
echo -e "OK, let's continue..."
|
||||
fi
|
||||
else
|
||||
echo "$casks_not_pinned" | xargs -n 1 brew upgrade --dry-run
|
||||
echo "$casks_not_pinned" | xargs -n 1 brew upgrade --cask
|
||||
fi
|
||||
|
||||
else
|
||||
@@ -360,7 +361,7 @@ if [ -n "$casks_latest_not_pinned" ] && [ "$latest" == true ]; then
|
||||
if [ "$display_info" = true ]; then
|
||||
[ "$nb_casks_latest_upd" -gt 1 ] && echo -e "${box} $nb_casks_latest_upd ${reset} ${array[@]/%/s}:\n" || echo -e "${box} $nb_casks_latest_upd ${reset} ${array[@]}:\n"
|
||||
|
||||
upd_casks_latest_info=$(brew info --json=v2 $upd_casks_latest | jq '{casks} | .[]')
|
||||
upd_casks_latest_info=$(brew info --cask --json=v2 $upd_casks_latest | jq '{casks} | .[]')
|
||||
for row in $upd_casks_latest;
|
||||
do
|
||||
get_info_cask "$upd_casks_latest_info" "$row"
|
||||
@@ -377,14 +378,14 @@ if [ -n "$casks_latest_not_pinned" ] && [ "$latest" == true ]; then
|
||||
read -p "$q" choice
|
||||
|
||||
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
||||
|
||||
echo ""
|
||||
for i in $casks_latest_not_pinned
|
||||
do
|
||||
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
|
||||
echo "\n$i" | xargs -p -n 1 brew upgrade
|
||||
echo "$i" | xargs -p -n 1 brew upgrade --cask
|
||||
echo ""
|
||||
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
||||
echo "\n$i" | xargs -n 1 brew upgrade
|
||||
echo "$i" | xargs -n 1 brew upgrade --cask
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -3,16 +3,25 @@
|
||||
# Mac Appstore plugin for KYMSU
|
||||
# https://github.com/welcoMattic/kymsu
|
||||
|
||||
echo -e "\033[1m🍏 Mac App Store updates come fast as lightning \033[0m"
|
||||
|
||||
# No distract mode (no user interaction)
|
||||
no_distract=false
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
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"
|
||||
|
||||
|
||||
echo -e "${bold}🍏 Mac App Store updates come fast as lightning ${reset}"
|
||||
|
||||
echo -e "https://github.com/mas-cli/mas"
|
||||
|
||||
# https://github.com/mas-cli/mas
|
||||
# On teste si mas est installé
|
||||
if hash mas 2>/dev/null; then
|
||||
|
||||
@@ -21,13 +30,13 @@ if hash mas 2>/dev/null; then
|
||||
echo "$massy"
|
||||
|
||||
if [ -n "$(mas outdated)" ]; then
|
||||
echo -e "\033[4mAvailables updates:\033[0m"
|
||||
echo -e "${underline}Availables updates:${reset}"
|
||||
echo "$massy" | cut -d " " -f2-5
|
||||
echo ""
|
||||
|
||||
if [ "$no_distract" = false ]; then
|
||||
|
||||
a=$(echo -e "Do you wanna run \033[1mmas upgrade\033[0m ? (y/n)")
|
||||
a=$(echo -e "Do you wanna run \033[1mmas upgrade${reset} ? (y/n)")
|
||||
read -pr "$a" choice
|
||||
case "$choice" in
|
||||
y|Y|o ) mas upgrade;;
|
||||
@@ -40,10 +49,10 @@ if hash mas 2>/dev/null; then
|
||||
fi
|
||||
|
||||
else
|
||||
echo -e "\033[4mNo availables mas updates.\033[0m"
|
||||
echo -e "${italic}No availables mas updates.${reset}"
|
||||
fi
|
||||
else
|
||||
echo "Please install mas: brew install mas"
|
||||
echo -e "Please install mas: ${italic}brew install mas${reset}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -3,29 +3,16 @@
|
||||
# npm plugin for KYMSU (install local package)
|
||||
# https://github.com/welcoMattic/kymsu
|
||||
|
||||
# Fixing npm On Mac OS X for Homebrew Users
|
||||
# https://gist.github.com/rcugut/c7abd2a425bb65da3c61d8341cd4b02d
|
||||
# https://gist.github.com/DanHerbert/9520689
|
||||
|
||||
# brew install node
|
||||
# node -v => 9.11.1
|
||||
# npm -v => 5.6.0
|
||||
|
||||
# npm install -g npm
|
||||
# npm -v => 5.8.0
|
||||
|
||||
# https://github.com/npm/npm/issues/17744
|
||||
|
||||
#########################################
|
||||
#
|
||||
# Settings:
|
||||
|
||||
# No distract mode (no user interaction)
|
||||
no_distract=false
|
||||
# Display info on updated pakages / casks
|
||||
display_info=true
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
# No distract mode (no user interaction)
|
||||
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
|
||||
# Set ls_color to '' for output nvm list in default colors, else '--no-colors'
|
||||
# ls_color='--no-colors'
|
||||
@@ -40,31 +27,60 @@ local_path=$HOME/Sites/node_modules/
|
||||
|
||||
#########################################
|
||||
|
||||
echo -e "\033[1m🌿 npm \033[0m"
|
||||
: <<'END_COMMENT'
|
||||
blabla
|
||||
END_COMMENT
|
||||
|
||||
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"
|
||||
reset="\033[0m"
|
||||
|
||||
upd_nvm() {(
|
||||
cd "$NVM_DIR"
|
||||
git fetch --tags origin
|
||||
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
|
||||
) && \. "$NVM_DIR/nvm.sh"
|
||||
}
|
||||
|
||||
|
||||
echo -e "${bold}🌿 npm ${reset}"
|
||||
echo ""
|
||||
|
||||
# version courante de node.js
|
||||
node_v=$(node -v)
|
||||
echo -e "\033[4m🌿 node.js\033[0m (current version): $node_v"
|
||||
node_ins=$(which node)
|
||||
echo -e "${underline}🌿 node.js:${reset}"
|
||||
echo -e " - current version: ${italic}$node_v${reset}"
|
||||
echo -e " - install path: ${italic}$node_ins${reset}"
|
||||
|
||||
# version courante de npm
|
||||
npm_v=$(npm -v)
|
||||
echo -e "\033[4m🌿 npm\033[0m (current version): $npm_v"
|
||||
npm_ins=$(which npm)
|
||||
echo -e "\n${underline}🌿 npm:${reset}"
|
||||
echo -e " - current version: ${italic}$npm_v${reset}"
|
||||
echo -e " - install path: ${italic}$npm_ins${reset}"
|
||||
|
||||
# version installée de nvm par Homebrew
|
||||
nvm_installed=$(brew info nvm | grep Cellar)
|
||||
# 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
|
||||
# nvm from 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"
|
||||
echo -e "\n${underline}🌿 nvm install is:${reset} $NVM_DIR/nvm.sh"
|
||||
echo " - nvm $nvm_v is installed from https://github.com/nvm-sh/nvm"
|
||||
|
||||
if [ "$nvm_v" != "$version_nvm" ]; then
|
||||
echo "Current nvm version on GitHub: $version_nvm"
|
||||
@@ -76,6 +92,7 @@ if [ -f "$NVM_DIR/nvm.sh" ]; then
|
||||
echo "Updating nvm from GitHub..."
|
||||
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v"$version_nvm"/install.sh | bash
|
||||
|
||||
upd_nvm
|
||||
#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
|
||||
@@ -83,14 +100,16 @@ if [ -f "$NVM_DIR/nvm.sh" ]; then
|
||||
fi
|
||||
|
||||
node_install=$(nvm list "$ls_color")
|
||||
echo -e "\033[4m🌿 node.js\033[0m (installed versions): \n$node_install"
|
||||
echo -e "\n${underline}🌿 node.js${reset} (installed versions): \n$node_install"
|
||||
|
||||
# homebrew
|
||||
# nvm from homebrew
|
||||
elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
|
||||
source $(brew --prefix nvm)/nvm.sh
|
||||
|
||||
# version courante de nvm
|
||||
nvm_v=$(nvm --version)
|
||||
echo -e "\033[4m🌿 nvm install is:\033[0m /usr/local/opt/nvm/nvm.sh"
|
||||
|
||||
echo -e "\n${underline}🌿 nvm install is:${reset} /usr/local/opt/nvm/nvm.sh"
|
||||
echo "nvm $nvm_v is installed from homebrew"
|
||||
|
||||
if [ "$nvm_v" != "$version_nvm" ]; then
|
||||
@@ -98,96 +117,135 @@ elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
|
||||
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."
|
||||
echo -e "or run \033[1;3mKymsu's homebrew.sh script.${reset}"
|
||||
fi
|
||||
|
||||
node_install=$(nvm list "$ls_color")
|
||||
echo -e "\033[4m🌿 node.js\033[0m (installed versions): \n$node_install"
|
||||
echo -e "\n${underline}🌿 node.js${reset} (installed versions): \n$node_install"
|
||||
|
||||
fi
|
||||
|
||||
echo -e "\033[3mNote:"
|
||||
echo -e "${italic}Note:"
|
||||
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 -e "You need to run \"nvm install 10.18.0\" to install it before using it.${reset}"
|
||||
|
||||
echo
|
||||
echo ""
|
||||
|
||||
##################
|
||||
# Local packages #
|
||||
##################
|
||||
|
||||
# Local packages
|
||||
if [ -d "$local_path" ]; then
|
||||
cd "$local_path" || return
|
||||
echo -e "\033[4m🌿 Local installed scripts:\033[0m"
|
||||
npm ls
|
||||
echo -e "${underline}🌿 Local installed scripts:${reset}"
|
||||
|
||||
if [ "$display_info" = true ]; then
|
||||
ll=$(npm ls --long | grep -v 'git$')
|
||||
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [[ "${line}" =~ "──" ]] || [[ "${line}" =~ "─┬" ]]; then
|
||||
echo -e "${bold}${line}${reset}"
|
||||
else
|
||||
echo -e "${line}"
|
||||
fi
|
||||
done <<< "$ll"
|
||||
else
|
||||
npm ls
|
||||
fi
|
||||
|
||||
|
||||
echo -e "\n${underline}🌿 Search for local packages update...${reset}\n"
|
||||
outdated=$(npm outdated)
|
||||
if [ -n "$outdated" ]; then
|
||||
echo "$outdated"
|
||||
echo "$outdated" | awk '{print $1}' | xargs npm update
|
||||
|
||||
echo -e "\n${underline}🌿 Updating local packages...${reset}\n"
|
||||
|
||||
if [ "$no_distract" = false ]; then
|
||||
#echo "$outdated"
|
||||
echo "$outdated" | awk '{print $1}' | xargs -p -n 1 npm update
|
||||
else
|
||||
#echo "$outdated"
|
||||
echo "$outdated" | awk '{print $1}' | xargs -n 1 npm update
|
||||
fi
|
||||
|
||||
else
|
||||
echo -e "\033[4mNo local packages updates.\033[0m"
|
||||
echo -e "${italic}No local packages updates.${reset}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Global packages
|
||||
echo -e "\033[4m🌿 Global installed scripts:\033[0m"
|
||||
npm list -g --depth=0
|
||||
###################
|
||||
# Global packages #
|
||||
###################
|
||||
|
||||
#g_outdated=$(npm outdated -g)
|
||||
g_outdated=$(npm outdated -g --parseable=true)
|
||||
echo -e "${underline}🌿 Global installed scripts:${reset}"
|
||||
|
||||
# => 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
|
||||
# /usr/local/lib/node_modules/npm/lib/outdated.js
|
||||
if [ "$display_info" = true ]; then
|
||||
lg=$(npm list -g --depth=0 --long | grep -v 'git$')
|
||||
|
||||
# update -> wanted ; install -> latest
|
||||
if [ -n "$g_outdated" ]; then
|
||||
if [ "$no_distract" = false ]; then
|
||||
#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 --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" | cut -d : -f 4 | xargs -n 1 npm -g install
|
||||
fi
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [[ "${line}" =~ "──" ]]; then
|
||||
echo -e "${bold}${line}${reset}"
|
||||
else
|
||||
echo -e "${line}"
|
||||
fi
|
||||
done <<< "$lg"
|
||||
else
|
||||
echo -e "\033[4mNo global packages updates.\033[0m"
|
||||
npm list -g --depth=0
|
||||
fi
|
||||
|
||||
|
||||
#Packages update
|
||||
echo -e "\n${underline}🌿 Search for global packages update...${reset}\n"
|
||||
|
||||
glong_outdated=$(npm outdated -g --long | sed '1d')
|
||||
|
||||
if [ -n "$glong_outdated" ]; then
|
||||
echo -e "$glong_outdated\n"
|
||||
echo -e "\n${underline}🌿 Updating global packages...${reset}\n"
|
||||
|
||||
while IFS= read -r line
|
||||
do
|
||||
pkg=$(echo "$line" | awk '{print $1}')
|
||||
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 -g install
|
||||
echo ""
|
||||
else
|
||||
echo "$outdated" | xargs -n 1 npm -g install
|
||||
echo ""
|
||||
fi
|
||||
|
||||
done <<< "$glong_outdated"
|
||||
|
||||
else
|
||||
echo -e "${italic}No global packages updates.${reset}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Maintenance
|
||||
###############
|
||||
# Maintenance #
|
||||
###############
|
||||
|
||||
if [ "$doctor" = true ]; then
|
||||
echo "🌿 The Doc is checking that everything is ok."
|
||||
echo -e "${underline}🌿 The Doc is checking that everything is ok.${reset}\n"
|
||||
npm doctor
|
||||
echo ""
|
||||
|
||||
echo "🔍 Verifying npm cache"
|
||||
echo -e "🔍 Verifying npm cache\n"
|
||||
npm cache verify
|
||||
echo ""
|
||||
fi
|
||||
|
||||
#if [[ $1 == "--npm_cleanup" ]]; then
|
||||
if [[ $1 == "--cleanup" ]]; then
|
||||
echo "npm cache clean"
|
||||
# As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid.
|
||||
# If you want to make sure everything is consistent, use 'npm cache verify' instead.
|
||||
# On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
|
||||
# If you're sure you want to delete the entire cache, rerun this command with --force.
|
||||
|
||||
if printf '%s\n%s\n' "$(npm --version)" 5.0.0 | sort --version-sort --check=silent; then
|
||||
echo "🌿 Cleaning npm cache"
|
||||
npm cache clean
|
||||
fi
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,10 +10,19 @@
|
||||
# Settings:
|
||||
|
||||
# No distract mode (no user interaction)
|
||||
no_distract=false
|
||||
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
|
||||
#
|
||||
#########################################
|
||||
|
||||
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"
|
||||
|
||||
notification() {
|
||||
sound="Basso"
|
||||
title="Homebrew"
|
||||
@@ -27,15 +36,11 @@ notification() {
|
||||
}
|
||||
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
|
||||
echo -e "\033[1m🐘 pecl \033[0m"
|
||||
echo -e "${bold}🐘 pecl ${reset}"
|
||||
|
||||
echo ""
|
||||
|
||||
echo -e "\033[1m❗️ plugin en test (beta) \033[0m"
|
||||
echo -e "${bold}❗️ plugin en test (beta) ${reset}"
|
||||
echo ""
|
||||
|
||||
# /usr/local/Cellar/php/7.4.11/bin/pecl
|
||||
@@ -60,7 +65,7 @@ pecl_upgrade=$($php_path/pecl list-upgrades)
|
||||
|
||||
if [ -n "$pecl_upgrade" ]; then
|
||||
|
||||
echo -e "\033[4mExtensions update:\033[0m"
|
||||
echo -e "${underline}Extensions update:${reset}"
|
||||
|
||||
echo ""
|
||||
echo "$pecl_upgrade"
|
||||
@@ -117,11 +122,11 @@ notif2="$conf_php was modified in the last 5 minutes"
|
||||
test=$(find "$dir" -name "$name" -mmin -5 -maxdepth 1)
|
||||
|
||||
if [ -n "$test" ]; then
|
||||
echo -e "\033[1;31m❗️ ️$notif2\033[0m"
|
||||
echo -e "${red}❗️ ️$notif2${reset}"
|
||||
notification "$notif2"
|
||||
echo ""
|
||||
|
||||
a=$(echo -e "Do you want to edit \033[1m$conf_php\033[0m file ? (y/n)")
|
||||
a=$(echo -e "Do you want to edit ${bold}$conf_php${reset} file ? (y/n)")
|
||||
read -p "$a" choice
|
||||
if [ "$choice" == "y" ]; then
|
||||
$EDITOR "$conf_php"
|
||||
|
||||
143
plugins.d/pip.sh
143
plugins.d/pip.sh
@@ -13,37 +13,47 @@
|
||||
#
|
||||
# Settings:
|
||||
|
||||
# Display info on updated pakages / casks
|
||||
#[[ $@ =~ "--info" ]] && display_info=false || display_info=true
|
||||
display_info=true
|
||||
|
||||
# No distract mode (no user interaction)
|
||||
[[ $@ =~ "--nodistract" ]] && 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=""
|
||||
# No distract mode
|
||||
no_distract=false
|
||||
#add module to do_not_update array
|
||||
|
||||
# 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=("asgiref")
|
||||
#
|
||||
#########################################
|
||||
|
||||
: <<'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"
|
||||
|
||||
if [[ $1 == "--nodistract" ]]; then
|
||||
no_distract=true
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v $pip_version)" ]; then
|
||||
echo "Error: $pip_version is not installed." >&2
|
||||
exit 1
|
||||
fi
|
||||
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}"
|
||||
|
||||
@@ -52,111 +62,108 @@ 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
|
||||
$pip_version install --upgrade pip > /dev/null
|
||||
#$pip_version install --upgrade pip > /dev/null
|
||||
echo ""
|
||||
|
||||
# Do not update casks
|
||||
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 "To remove package from this list, you need to edit the do_not_update array."
|
||||
echo -e "To remove package from this list, you need to edit the ${italic}do_not_update${reset} array."
|
||||
echo ""
|
||||
|
||||
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}')
|
||||
#upd="asgiref CairoSVG setuptools"
|
||||
|
||||
# Find infos about updated packages
|
||||
if [ -n "$upd" ]; then
|
||||
|
||||
nb=$(echo "$upd" | wc -w | xargs)
|
||||
|
||||
echo -e "${redbox} $nb ${reset} ${underline}availables updates:${reset}"
|
||||
#echo $pip3_outdated_freeze | tr [:space:] '\n'
|
||||
echo "$pip_outdated"
|
||||
echo -e "\n$pip_outdated"
|
||||
echo ""
|
||||
|
||||
for i in $upd
|
||||
do
|
||||
info=$($pip_version show "$i")
|
||||
echo "$info" | head -4
|
||||
echo ""
|
||||
done
|
||||
do
|
||||
info=$($pip_version show "$i")
|
||||
|
||||
if [ -x "$(command -v pipdeptree)" ]; then
|
||||
echo -e "${underline}Check dependancies:${reset}"
|
||||
echo "Be carefull!! This updates can be a dependancie for some modules. Check for any incompatible version."
|
||||
fi
|
||||
echo ""
|
||||
for i in $upd
|
||||
do
|
||||
if [ -x "$(command -v pipdeptree)" ]; then
|
||||
dependencies=$(echo "$i" | xargs pipdeptree -r -p | grep "$upd")
|
||||
l=$(echo "$info" | sed -n '1p')
|
||||
m=$(sed "1s/.*/\\${bold}$l\\${reset}/" <<< "$info")
|
||||
echo -e "$m" | head -4
|
||||
echo ""
|
||||
|
||||
#asgiref==3.2.10
|
||||
# - Django==3.1.2 [requires: asgiref~=3.2.10]
|
||||
z+="$i "
|
||||
|
||||
#parso==0.7.1
|
||||
# - jedi==0.17.2 [requires: parso>=0.7.0,<0.8.0]
|
||||
done
|
||||
|
||||
z=0
|
||||
while read -r line; do
|
||||
if [[ $line = *"<"* ]]; then
|
||||
echo -e "${red}$line${reset}"
|
||||
elif [[ $line = *"~="* ]]; then
|
||||
echo -e "${yellow}$line${reset}"
|
||||
else
|
||||
if [ "$z" -eq 0 ]; then
|
||||
echo -e "${italic}$line${reset}"
|
||||
else
|
||||
echo "$line"
|
||||
fi
|
||||
z=$((z+1))
|
||||
fi
|
||||
done <<< "$dependencies"
|
||||
echo ""
|
||||
# Check dependancies
|
||||
if [ -x "$(command -v pipdeptree)" ] && [ "$display_depend" == true ]; then
|
||||
|
||||
echo -e "🐍 ${underline}Check dependancies:${reset}\n"
|
||||
echo -e "Be carefull!! This updates can be a dependancie for some modules. Check for any incompatible version.\n"
|
||||
|
||||
z=$(echo "$z" | sed 's/.$//' | sed 's/ /,/g')
|
||||
dependencies=$(echo "$z" | xargs pipdeptree -r -p )
|
||||
|
||||
while IFS= read -r line; do
|
||||
z=$(echo "${line}" | grep -i ^[a-z])
|
||||
if [ -n "$z" ] ; then
|
||||
echo -e "\n${bold}${line}${reset}"
|
||||
elif [[ "${line}" = *"<"* ]]; then
|
||||
echo -e "${red}${line}${reset}"
|
||||
elif [[ "${line}" = *"~="* ]]; then
|
||||
echo -e "${yellow}${line}${reset}"
|
||||
else
|
||||
c=$(echo -e "Do you want to install pipdeptree to check dependancies ? (y/n)")
|
||||
read -pr "$c" choice
|
||||
case "$choice" in
|
||||
y|Y|o ) $pip_version install $user pipdeptree ;;
|
||||
n|N ) echo "Ok, let's continue";;
|
||||
* ) echo "invalid";;
|
||||
esac
|
||||
|
||||
echo "${line}"
|
||||
fi
|
||||
done <<< "$dependencies"
|
||||
|
||||
# If the update is not in the do_not_update array, we install it.
|
||||
fi
|
||||
|
||||
FOUND=`echo ${do_not_update[*]} | grep "$i"`
|
||||
if [ "${FOUND}" = "" ] && [ "$no_distract" = false ]; then
|
||||
|
||||
b=$(echo -e "Do you wanna run ${bold}$pip_version install $user --upgrade $i${reset} ? (y/n)")
|
||||
# Updating packages
|
||||
echo -e "\n🐍 ${underline}Updating packages...${reset}\n"
|
||||
|
||||
[ "${#do_not_update[@]}" -gt 0 ] && echo -e "${redbold}Do not update: ${underline}${do_not_update[@]}${reset}${redbold} . It won't be updated!'${reset}\n"
|
||||
|
||||
for i in $upd
|
||||
do
|
||||
if [[ ! " ${do_not_update[@]} " =~ " ${i} " ]]; then
|
||||
if [ "$no_distract" = false ]; then
|
||||
|
||||
b=$(echo -e "Do you wanna run ${bold}$pip_version install $user --upgrade $i${reset} ? (y/n)")
|
||||
read -p "$b" choice
|
||||
case "$choice" in
|
||||
y|Y|o ) echo "$i" | xargs $pip_version install $user --upgrade ;;
|
||||
n|N ) echo "Ok, let's continue";;
|
||||
n|N ) echo "Ok, let's continue";;
|
||||
* ) echo "invalid";;
|
||||
esac
|
||||
echo ""
|
||||
|
||||
elif [ "${FOUND}" = "" ]; then
|
||||
|
||||
else
|
||||
echo "$i" | xargs $pip_version install $user --upgrade
|
||||
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
echo -e "${underline}No availables updates.${reset}"
|
||||
fi
|
||||
|
||||
|
||||
echo ""
|
||||
echo -e "🐍 Running ${bold}pip check${reset} for checking that everything is ok."
|
||||
echo -e "🐍 ${underline}Running ${reset}${bold_under}pip check${reset}${underline} for checking that everything is ok...${reset}\n"
|
||||
|
||||
$pip_version check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user