Compare commits
10 Commits
cefbd6d1e9
...
40040c264b
| Author | SHA1 | Date | |
|---|---|---|---|
| 40040c264b | |||
| b76e72a1ef | |||
| c8ced14004 | |||
| 6ee801d946 | |||
| feab0bb267 | |||
| 02ed39943b | |||
| bcd4ca41c6 | |||
| d13e3277b1 | |||
| de82e3f6a3 | |||
| db3ef113ad |
@@ -21,6 +21,7 @@ homebrew and pecl plugins notifie you if apache/php configuration files have bee
|
|||||||
- **perl** (Perl modules ([cpan](https://metacpan.org)))
|
- **perl** (Perl modules ([cpan](https://metacpan.org)))
|
||||||
- **pip** ([Python Package index](https://pypi.org)) (pip or pip3)
|
- **pip** ([Python Package index](https://pypi.org)) (pip or pip3)
|
||||||
- **pipx** ([Python Apps in Isolated Environments](https://pypa.github.io/pipx/))
|
- **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))
|
- **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>
|
- **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:
|
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
|
```bash
|
||||||
$ nano homebrew.sh
|
$ 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]* 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.*
|
*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"`
|
- *[pip]* `version=pip or pip3` `user="" or "--user"`
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ function showHelp() {
|
|||||||
all_plugins=false
|
all_plugins=false
|
||||||
no_distract=false
|
no_distract=false
|
||||||
brew_cleanup=false
|
brew_cleanup=false
|
||||||
|
SCRIPTS_DIR=$HOME/.kymsu/plugins.d
|
||||||
|
|
||||||
while getopts "hncs: a-:" opt
|
while getopts "hncs: a-:" opt
|
||||||
do
|
do
|
||||||
@@ -62,23 +63,26 @@ done
|
|||||||
|
|
||||||
#shift "$((OPTIND-1))"
|
#shift "$((OPTIND-1))"
|
||||||
|
|
||||||
SCRIPTS_DIR=$HOME/.kymsu/plugins.d
|
|
||||||
|
|
||||||
# -n : non vide
|
# -n : non vide
|
||||||
if [ -n "$one_script" ]; then
|
if [ -n "$one_script" ]; then
|
||||||
# Un seul script
|
# 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
|
[ -z "$list_plugins" ] && echo -e "❗️ No named plugin ${italic}$one_script${reset}" && exit -1
|
||||||
|
|
||||||
# [[ $@ =~ "--all" ]] && all_plugins=true || all_plugins=false
|
# [[ $@ =~ "--all" ]] && all_plugins=true || all_plugins=false
|
||||||
elif [ "$all_plugins" = false ]; then
|
elif [ "$all_plugins" = false ]; then
|
||||||
# Tous sauf commençant par _ (les fichiers commençant par '_' ne sont pas pris en compte) "_*.sh"
|
# 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)
|
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
|
else
|
||||||
# Tous (-a = ET; -perm +111 = exec)
|
# Tous (-a = ET; -perm +111 = exec)
|
||||||
list_plugins=$(find $SCRIPTS_DIR -maxdepth 1 -type f -name "*.sh" -a -perm +111 | sort)
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd "$SCRIPTS_DIR"
|
cd "$SCRIPTS_DIR"
|
||||||
|
|
||||||
<<COMMENT
|
<<COMMENT
|
||||||
@@ -97,6 +101,7 @@ echo ""
|
|||||||
for script in $list_plugins; do
|
for script in $list_plugins; do
|
||||||
# le $@ permet de passer à chaque script les arguments passés à *ce* script
|
# le $@ permet de passer à chaque script les arguments passés à *ce* script
|
||||||
$script $@
|
$script $@
|
||||||
|
#echo "$script"
|
||||||
done
|
done
|
||||||
|
|
||||||
shift "$((OPTIND-1))"
|
shift "$((OPTIND-1))"
|
||||||
|
|||||||
@@ -1,6 +1,57 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo "🦄 KYMSU self update"
|
|
||||||
pushd "$(cat ~/.kymsu/path)" > /dev/null
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
git pull
|
#PREF_FILE="$SCRIPT_DIR/kymsu.pref"
|
||||||
popd > /dev/null
|
#TEMP_FILE="$SCRIPT_DIR/kymsu.pref.tmp"
|
||||||
echo ""
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ get_info_cask() {
|
|||||||
#auto_updates=$(echo "$info" | jq -r '.[] | select(.token == "'${app}'") | (.auto_updates)')
|
#auto_updates=$(echo "$info" | jq -r '.[] | select(.token == "'${app}'") | (.auto_updates)')
|
||||||
#caveats=$(echo "$info" | jq -r '.[] | select(.token == "'${app}'") | (.caveats)')
|
#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)')
|
current_version=$(echo "$upd_cask" | jq -r '.[] | select(.name == "'${app}'") | (.current_version)')
|
||||||
|
|
||||||
[[ "$desc" = "null" ]] && desc="${italic}No description${reset}"
|
[[ "$desc" = "null" ]] && desc="${italic}No description${reset}"
|
||||||
@@ -117,6 +117,7 @@ get_info_pkg() {
|
|||||||
#echo -e "installed: $installed\n"
|
#echo -e "installed: $installed\n"
|
||||||
|
|
||||||
installed_versions=$(echo "$upd_package" | jq -r '.[] | select(.name == "'${pkg2}'") | (.installed_versions)' | jq -r '.[]')
|
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)')
|
current_version=$(echo "$upd_package" | jq -r '.[] | select(.name == "'${pkg2}'") | (.current_version)')
|
||||||
#echo -e "installed_versions: $installed_versions\n"
|
#echo -e "installed_versions: $installed_versions\n"
|
||||||
#echo "stable: $current_version"
|
#echo "stable: $current_version"
|
||||||
@@ -151,6 +152,13 @@ get_info_pkg() {
|
|||||||
|
|
||||||
echo -e "${bold}🍺 Homebrew ${reset}"
|
echo -e "${bold}🍺 Homebrew ${reset}"
|
||||||
|
|
||||||
|
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 "\n🍺 ${underline}Updating brew...${reset}\n"
|
echo -e "\n🍺 ${underline}Updating brew...${reset}\n"
|
||||||
brew update
|
brew update
|
||||||
|
|
||||||
@@ -240,6 +248,11 @@ if [ -n "$upd_pkg_notpinned" ]; then
|
|||||||
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
||||||
for i in $upd_pkg_notpinned;
|
for i in $upd_pkg_notpinned;
|
||||||
do
|
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
|
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
|
||||||
echo "$i" | xargs -p -n 1 brew upgrade
|
echo "$i" | xargs -p -n 1 brew upgrade
|
||||||
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
|
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: Unfinished string at EOF at line 2, column 0
|
||||||
# parse error: Invalid numeric literal at line 1, column 7
|
# parse error: Invalid numeric literal at line 1, column 7
|
||||||
|
|
||||||
|
#echo "$upd_cask"
|
||||||
|
|
||||||
for row in $(jq -c '.[]' <<< "$upd_cask");
|
for row in $(jq -c '.[]' <<< "$upd_cask");
|
||||||
do
|
do
|
||||||
name=$(echo "$row" | jq -j '.name')
|
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')
|
current_version=$(echo "$row" | jq -j '.current_version')
|
||||||
|
|
||||||
if [ "$current_version" != "latest" ]; then
|
if [ "$current_version" != "latest" ]; then
|
||||||
|
|||||||
1
plugins.d/kymsu.pref
Normal file
1
plugins.d/kymsu.pref
Normal file
@@ -0,0 +1 @@
|
|||||||
|
last.update=1658067929
|
||||||
@@ -30,6 +30,11 @@ update_node=false
|
|||||||
# run 'npm init' in local_path to create package.json
|
# run 'npm init' in local_path to create package.json
|
||||||
local_path=$HOME/Sites/
|
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'
|
: <<'END_COMMENT'
|
||||||
@@ -44,6 +49,8 @@ red="\033[1;31m"
|
|||||||
bold="\033[1m"
|
bold="\033[1m"
|
||||||
bold_ita="\033[1;3m"
|
bold_ita="\033[1;3m"
|
||||||
box="\033[1;41m"
|
box="\033[1;41m"
|
||||||
|
redbold="\033[1;31m"
|
||||||
|
redbox="\033[1;41m"
|
||||||
reset="\033[0m"
|
reset="\033[0m"
|
||||||
|
|
||||||
upd_nvm() {(
|
upd_nvm() {(
|
||||||
@@ -75,6 +82,14 @@ echo -e "\n${underline}🌿 npm:${reset}"
|
|||||||
echo -e " - current version: ${italic}$npm_v${reset}"
|
echo -e " - current version: ${italic}$npm_v${reset}"
|
||||||
echo -e " - install path: ${italic}$npm_ins${reset}"
|
echo -e " - install path: ${italic}$npm_ins${reset}"
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
# version installée de nvm par Homebrew
|
# version installée de nvm par Homebrew
|
||||||
# nvm_installed=$(brew info nvm | grep Cellar)
|
# nvm_installed=$(brew info nvm | grep Cellar)
|
||||||
|
|
||||||
@@ -142,6 +157,19 @@ echo -e "You need to run \"nvm install 10.18.0\" to install it before using it.$
|
|||||||
|
|
||||||
echo ""
|
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 #
|
# Local packages #
|
||||||
##################
|
##################
|
||||||
@@ -203,21 +231,27 @@ if find "$local_path/node_modules" -mindepth 1 -maxdepth 1 | read; then
|
|||||||
j=$(echo "$current" | awk -F "." '{print $1}')
|
j=$(echo "$current" | awk -F "." '{print $1}')
|
||||||
k=$(echo "$latest" | awk -F "." '{print $1}')
|
k=$(echo "$latest" | awk -F "." '{print $1}')
|
||||||
|
|
||||||
# Update major version 1.x.y to 2.x.y
|
if [[ ! " ${do_not_update[@]} " =~ " ${package} " ]]; then
|
||||||
if [ $current = $wanted ] && [ "$j" -lt "$k" ]; then
|
|
||||||
if [ "$no_distract" = false ]; then
|
# Update major version 1.x.y to 2.x.y
|
||||||
echo "$package@latest" | xargs -p npm install
|
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
|
else
|
||||||
echo "$package@latest" | xargs npm install
|
if [ "$no_distract" = false ]; then
|
||||||
#npm install "$package@latest"
|
echo "$package" | xargs -p npm update
|
||||||
fi
|
else
|
||||||
# Update minor or patch version
|
echo "$package" | xargs npm update
|
||||||
else
|
fi
|
||||||
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
|
fi
|
||||||
|
|
||||||
done <<< "$outdated"
|
done <<< "$outdated"
|
||||||
@@ -287,20 +321,28 @@ if [ -n "$glong_outdated" ]; then
|
|||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
do
|
do
|
||||||
pkg=$(echo "$line" | awk '{print $1}')
|
pkg=$(echo "$line" | awk '{print $1}')
|
||||||
|
curr=$(echo "$line" | awk '{print $2}')
|
||||||
vers=$(echo "$line" | awk '{print $4}')
|
vers=$(echo "$line" | awk '{print $4}')
|
||||||
outdated="$pkg@$vers"
|
outdated="$pkg@$vers"
|
||||||
|
|
||||||
# TEST
|
|
||||||
#version=$(echo "$line" | awk '{print $1 "@" $4}')
|
|
||||||
#echo "$version"
|
|
||||||
# /test
|
|
||||||
|
|
||||||
if [ "$no_distract" = false ]; then
|
if [[ ! " ${do_not_update[@]} " =~ " ${pkg} " ]]; then
|
||||||
echo "$outdated" | xargs -p -n 1 npm --location=global install
|
|
||||||
echo ""
|
# 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
|
else
|
||||||
echo "$outdated" | xargs -n 1 npm --location=global install
|
echo -e "${redbold}$pkg is pinned to version $curr !${reset} Don't update !"
|
||||||
echo ""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done <<< "$glong_outdated"
|
done <<< "$glong_outdated"
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ version=$(php --info | grep 'PHP Version' | sed -n '1p' | awk -F" " '{print $NF}
|
|||||||
v=${version:0:3}
|
v=${version:0:3}
|
||||||
echo -e "${ita_under}${blue}Current PHP version:${reset} ${bold}$version${reset}\n"
|
echo -e "${ita_under}${blue}Current PHP version:${reset} ${bold}$version${reset}\n"
|
||||||
|
|
||||||
latest="8.0"
|
latest="8.2"
|
||||||
versions=("7.2" "7.3" "7.4" "8.1" "$latest")
|
versions=("7.4" "8.0" "8.1" "8.3" "$latest")
|
||||||
php_installed=$(ls -1 $(brew --prefix)/opt/ | grep php@)
|
php_installed=$(ls -1 $(brew --prefix)/opt/ | grep php@)
|
||||||
echo -e "${ita_under}${blue}Installed PHP versions:${reset}"
|
echo -e "${ita_under}${blue}Installed PHP versions:${reset}"
|
||||||
echo -e "$php_installed\n"
|
echo -e "$php_installed\n"
|
||||||
@@ -94,6 +94,12 @@ fi
|
|||||||
pecl version
|
pecl version
|
||||||
|
|
||||||
|
|
||||||
|
curl -Is http://www.google.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"
|
# Note that all public channels can be synced using "update-channels"
|
||||||
echo -e "\n${ita_under}${blue}Updating all channels...${reset}"
|
echo -e "\n${ita_under}${blue}Updating all channels...${reset}"
|
||||||
|
|||||||
@@ -16,6 +16,20 @@ display_info=true
|
|||||||
# Also add module for prevent to update it.
|
# Also add module for prevent to update it.
|
||||||
declare -a do_not_update=('')
|
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_app=$(which perl)
|
||||||
perl_v=$(perl -v | sed -n '2p')
|
perl_v=$(perl -v | sed -n '2p')
|
||||||
@@ -42,10 +56,17 @@ else
|
|||||||
install_ok=true
|
install_ok=true
|
||||||
fi
|
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
|
||||||
|
|
||||||
if [ "$install_ok" == "true" ]; then
|
if [ "$install_ok" == "true" ]; then
|
||||||
echo "$module installed"
|
|
||||||
|
|
||||||
# install with cpan
|
# install with cpan
|
||||||
# % cpan-outdated | xargs cpan -i
|
# % cpan-outdated | xargs cpan -i
|
||||||
|
|
||||||
# install with cpanm
|
# install with cpanm
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ user=""
|
|||||||
# Add module to the do_not_update array for prevent to update.
|
# Add module to the do_not_update array for prevent to update.
|
||||||
#declare -a do_not_update=()
|
#declare -a do_not_update=()
|
||||||
#declare -a do_not_update=("parso" "asgiref")
|
#declare -a do_not_update=("parso" "asgiref")
|
||||||
declare -a do_not_update=("charset-normalizer")
|
declare -a do_not_update=("geomet")
|
||||||
#
|
#
|
||||||
#########################################
|
#########################################
|
||||||
|
|
||||||
@@ -78,6 +78,13 @@ if (( ${#do_not_update[@]} )); then
|
|||||||
fi
|
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
|
||||||
|
|
||||||
#Packages update
|
#Packages update
|
||||||
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
|
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
|
||||||
|
|
||||||
@@ -126,10 +133,12 @@ if [ -n "$upd" ]; then
|
|||||||
dependencies=$(echo "$x" | xargs pipdeptree -r -p | grep -E $y)
|
dependencies=$(echo "$x" | xargs pipdeptree -r -p | grep -E $y)
|
||||||
echo -e ""
|
echo -e ""
|
||||||
|
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
z=$(echo "${line}" | grep -i ^[a-z])
|
z=$(echo "${line}" | grep -i ^[a-z])
|
||||||
k=$(echo "${line}" | awk -F'==' '{print $1}')
|
k=$(echo "${line}" | awk -F'==' '{print $1}')
|
||||||
l=$(echo "${line}" | awk -F':' '{print $2}')
|
l=$(echo "${line}" | awk -F':' '{print $2}')
|
||||||
|
|
||||||
|
|
||||||
# Si la ligne commence par une lettre (aka. paquet à mettre à jour)
|
# Si la ligne commence par une lettre (aka. paquet à mettre à jour)
|
||||||
if [ -n "$z" ] ; then
|
if [ -n "$z" ] ; then
|
||||||
|
|||||||
@@ -36,10 +36,17 @@ then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
list=$(pipx list --include-injected)
|
list=$(pipx list --include-injected) # pipx list --quiet
|
||||||
echo -e "\n${underline}List installed packages:${reset}"
|
echo -e "\n${underline}List installed packages:${reset}"
|
||||||
echo "$list"
|
echo "$list"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
pipx-outdated() {
|
pipx-outdated() {
|
||||||
echo -e "\n${underline}Outdated Packages:${reset}"
|
echo -e "\n${underline}Outdated Packages:${reset}"
|
||||||
while read -sr pyPkgName pyPkyVersion; do
|
while read -sr pyPkgName pyPkyVersion; do
|
||||||
|
|||||||
50
plugins.d/rustup.sh
Executable file
50
plugins.d/rustup.sh
Executable 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 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
|
||||||
|
|
||||||
|
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 ""
|
||||||
@@ -18,7 +18,7 @@ reset="\033[0m"
|
|||||||
|
|
||||||
# Liste des apps:
|
# Liste des apps:
|
||||||
# - le venv doit avoir le même nom que l'app
|
# - le venv doit avoir le même nom que l'app
|
||||||
declare -a apps=("soco-cli" "mkdocs")
|
declare -a apps=("soco-cli" "mkdocs" "streamrip")
|
||||||
|
|
||||||
# Liste des extensions pour 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")
|
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,15 @@ elif [[ "$OSTYPE" == "linux_gnu" ]]; then
|
|||||||
elif [[ "$OSTYPE" == "linux_gnueabihf" ]]; then
|
elif [[ "$OSTYPE" == "linux_gnueabihf" ]]; then
|
||||||
v=$HOME/venv
|
v=$HOME/venv
|
||||||
fi
|
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
|
||||||
|
|
||||||
|
################################################################################################
|
||||||
|
|
||||||
for app in ${apps[*]}
|
for app in ${apps[*]}
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user