Dossier test

This commit is contained in:
2018-03-12 06:25:43 +01:00
parent 7ea415b906
commit bca8a94150
10 changed files with 218 additions and 0 deletions

30
_test/_cask.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
echo "🍺 Casks upgrade."
cask_outdated=$(brew cask outdated --greedy --verbose)
outdated=$(echo "$cask_outdated" | grep -v '(latest)')
if [ -n "$outdated" ]; then
echo "$outdated"
echo "$outdated" | awk '{print $1}' | awk '{print $1}' | xargs brew cask reinstall
else
echo -e "\033[4mNo availables Cask updates.\033[0m"
fi
echo ""
latest=$(echo "$cask_outdated" | grep '(latest)')
if [ -n "$latest" ]; then
echo -e "\033[4mCasks (latest):\033[0m"
echo "$latest" | cut -d " " -f1,2
echo ""
read -p "Do you wanna run Cask (latest) upgrade? (y/n)" choice
case "$choice" in
y|Y|o ) echo "$latest" | awk '{print $1}' | xargs -p -n 1 brew cask upgrade --greedy ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
fi

22
_test/_mas_test.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
if [[ "${1}" == "latest" ]]; then
echo "mas"
fi
echo "🍏 Mac App Store updates come fast as lightning"
#mas outdated
massy=`mas outdated`
echo ""
if [ -n "$massy" ]; then
#if [ $massy != 0 ]; then
read -p "Do you wanna run mas upgrade? (y/n)" choice
case "$choice" in
y|Y|o ) mas upgrade;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
echo ""
fi

17
_test/_pip.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
echo "🐍 pip"
echo ""
echo "🐍 update pip (Python 2)(macOS)"
echo ""
pip install --user --upgrade pip
pip install --user --upgrade mkdocs
pip install --user --upgrade mkdocs-material
pip list --outdated --format=columns
echo ""
echo "🐍 update pip3 (Python 3)(Homebrew)"
echo ""
pip3 install --upgrade pip
pip3 install --upgrade mkdocs
pip3 install --upgrade mkdocs-material
pip3 list --outdated --format=columns
echo ""

70
_test/_pip2.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bash
echo "🐍 pip"
echo ""
<<COMMENT
echo "🐍 update pip (Python 2)(macOS)"
echo ""
pip install --user --upgrade pip
#pip install --user --upgrade mkdocs
#pip install --user --upgrade mkdocs-material
echo ""
pip_outdated=$(pip list --outdated --format=freeze)
upd=$(echo $pip_outdated | tr [:space:] '\n' | awk -F== '{print $1}')
if [ -n "$upd" ]; then
echo -e "\033[4mAvailables updates:\033[0m"
echo $pip_outdated | tr [:space:] '\n'
echo ""
a=$(echo -e "Do you wanna run \033[1mpip install --user --upgrade "$upd"\033[0m ? (y/n)")
read -p "$a" choice
case "$choice" in
y|Y|o ) echo $upd | xargs -p -n 1 pip install --user --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
else
echo -e "\033[4mNo availables updates.\033[0m"
fi
echo ""
COMMENT
echo "🐍 update pip3 (Python 3)(Homebrew)"
echo ""
pip3 install --upgrade pip
#pip3 install --upgrade mkdocs
#pip3 install --upgrade mkdocs-material
echo ""
pip3_outdated=$(pip3 list --outdated --format=freeze)
upd3=$(echo $pip3_outdated | tr [:space:] '\n' | awk -F== '{print $1}')
if [ -n "$upd3" ]; then
echo -e "\033[4mAvailables updates:\033[0m"
echo $pip3_outdated | tr [:space:] '\n'
echo ""
a=$(echo -e "Do you wanna run \033[1mpip3 install --upgrade "$upd3"\033[0m ? (y/n)")
read -p "$a" choice
case "$choice" in
y|Y|o ) echo $upd3 | xargs -p -n 1 pip3 install --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
else
echo -e "\033[4mNo availables updates.\033[0m"
fi
echo ""
#pip install --upgrade packaging Sphinx ? (y/n)n
#python 2 : packaging installé global

67
_test/_pip_upd.sh Executable file
View File

@@ -0,0 +1,67 @@
#!/usr/bin/env bash
echo "🐍 pip"
echo ""
echo "🐍 update pip3 (Python 3)(Homebrew)"
echo ""
# Fichier temp:
pip3 list --outdated --format=freeze > pip.txt
if [ $(cat pip.txt | wc -l) -gt 0 ]; then
pip_outdated=$(cat pip.txt | awk -F== '{print $1}')
echo -e "\033[4mAvailables updates:\033[0m"
cat pip.txt
b=$(echo -e "Do you wanna run \033[1mpip install --upgrade "$pip_outdated"\033[0m ? (y/n)")
read -p "$b" choice
case "$choice" in
y|Y|o ) cat pip.txt | awk -F== '{print $1}' | tr [:space:] '\n' | xargs -p -n 1 touch;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
echo ""
rm pip.txt
else
echo -e "\033[4mNo availables updates.\033[0m"
fi
# Variable:
pip3_outdated=$(pip3 list --outdated --format=freeze)
upd3=$(echo $pip3_outdated | tr [:space:] '\n' | awk -F== '{print $1}')
if [ -n "$upd3" ]; then
echo -e "\033[4mAvailables updates:\033[0m"
echo $pip3_outdated | tr [:space:] '\n'
echo ""
a=$(echo -e "Do you wanna run \033[1mpip3 install --upgrade "$upd3"\033[0m ? (y/n)")
read -p "$a" choice
case "$choice" in
y|Y|o ) echo $upd3 | xargs -p -n 1 pip3 install --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
else
echo -e "\033[4mNo availables updates.\033[0m"
fi
echo ""
#pip_outdated=$(echo $(pip3 list --outdated --format=freeze) | tr [:space:] '\n')
#echo $pip_outdated
#pip freeze > requirements.txt && pip install --upgrade -r requirements.txt && rm requirements.txt
#pip3 list --outdated --format=freeze | awk -F== '{print $1}' | xargs -n1 -p pip install --upgrade

12
_test/param.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
if [[ "${1}" == "latest" ]]; then
echo $1
fi
#[ -d ~/.kymsu/plugins.d -a -x ~/.kymsu/plugins.d ] && find ~/.kymsu/plugins.d -type f -name '*.sh' -perm +u+x -exec bash -c {} ${1:no-cleanup} \;
find . -type f -name '_mas*.sh' -perm +u+x -exec bash -c {} "$1" \;
#find ~/.kymsu/plugins.d -type f -name '_m*.sh' -perm +u+x | xargs exec "$1" ;