First commit

Plugins:
-npm (Javascript)
-mas (MacAppstore)
-pip (Python 3)
-homebrew (and casks)
This commit is contained in:
2018-03-11 15:53:53 +01:00
commit e08f24727c
4 changed files with 152 additions and 0 deletions

75
_homebrew.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
# Homebrew plugin for KYMSU
# https://github.com/welcoMattic/kymsu
if [[ "${1}" == "latest" ]]; then
echo "toto"
fi
echo "🍺 Homebrew"
brew update
echo ""
brew_outdated=$(brew outdated)
upd3=$(echo "$brew_outdated" | awk '{print $1}')
#brewsy=$(echo "$brew_outdated" | wc -l | awk {'print $1'})
echo ":$upd3:"
#if [ "$upd3" != "" ]; then
if [ -n "$upd3" ]; then
a=$(echo -e "Do you wanna run \033[1mbrew upgrade "$upd3"\033[0m? (y/n)")
read -p "$a" choice
case "$choice" in
y|Y ) echo "$brew_outdated" | awk '{print $1}' | xargs -p -n 1 brew upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
echo ""
fi
echo "🍺 Casks upgrade."
#brew cask outdated --greedy --verbose | grep -v '(latest)' | awk '{print $1}' | xargs brew cask reinstall
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
#if [[ $1 == "latest" ]]; then
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
#fi
echo ""
echo "🍺 The Doc is checking that everything is ok."
brew doctor
brew missing
echo ""
if [[ $1 == "cleanup" ]]; then
echo "🍺 Cleaning brewery"
#brew cleanup -s
brew cleanup --prune=30
#brew cask cleanup
brew cask cleanup --outdated
fi

29
_mas.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Mac Appstore plugin for KYMSU
# https://github.com/welcoMattic/kymsu
echo "🍏 Mac App Store updates come fast as lightning"
#mas outdated
massy=`mas outdated`
echo ""
if [ -n "$massy" ]; then
#if [ "$massy" != 0 ]; then
echo -e "\033[4mAvailables updates:\033[0m"
echo "$massy" | cut -d " " -f2-5
echo ""
a=$(echo -e "Do you wanna run \033[1mmas upgrade\033[0m ? (y/n)")
read -p "$a" choice
case "$choice" in
y|Y|o ) mas upgrade;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
else
echo -e "\033[4mNo availables mas updates.\033[0m"
fi
echo ""

11
_npm.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# npm plugin for KYMSU (install local package)
# https://github.com/welcoMattic/kymsu
echo " 🌿 npm"
cd /Users/bruno/Sites/node_modules/
npm ls
npm outdated
npm outdated | awk '{print $1}' | xargs npm update
echo ""

37
_pip.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# pip plugin for KYMSU
# https://github.com/welcoMattic/kymsu
echo "🐍 pip"
echo ""
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 ""