commit e08f24727cdb7551317651998873d7e2abdd2e75 Author: Bruno 21 Date: Sun Mar 11 15:53:53 2018 +0100 First commit Plugins: -npm (Javascript) -mas (MacAppstore) -pip (Python 3) -homebrew (and casks) diff --git a/_homebrew.sh b/_homebrew.sh new file mode 100755 index 0000000..cf18d80 --- /dev/null +++ b/_homebrew.sh @@ -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 diff --git a/_mas.sh b/_mas.sh new file mode 100755 index 0000000..1ef06b2 --- /dev/null +++ b/_mas.sh @@ -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 "" diff --git a/_npm.sh b/_npm.sh new file mode 100755 index 0000000..53176b1 --- /dev/null +++ b/_npm.sh @@ -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 "" diff --git a/_pip.sh b/_pip.sh new file mode 100755 index 0000000..b6e9bfa --- /dev/null +++ b/_pip.sh @@ -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 ""