diff --git a/_test/_cask.sh b/_test/_cask.sh new file mode 100755 index 0000000..d1226a1 --- /dev/null +++ b/_test/_cask.sh @@ -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 diff --git a/_test/_mas_test.sh b/_test/_mas_test.sh new file mode 100755 index 0000000..0d94fb4 --- /dev/null +++ b/_test/_mas_test.sh @@ -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 diff --git a/_mkdocs.command b/_test/_mkdocs.command similarity index 100% rename from _mkdocs.command rename to _test/_mkdocs.command diff --git a/_mkdocs.sh b/_test/_mkdocs.sh similarity index 100% rename from _mkdocs.sh rename to _test/_mkdocs.sh diff --git a/_test/_pip.sh b/_test/_pip.sh new file mode 100755 index 0000000..25b9ee3 --- /dev/null +++ b/_test/_pip.sh @@ -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 "" diff --git a/_test/_pip2.sh b/_test/_pip2.sh new file mode 100755 index 0000000..618fc92 --- /dev/null +++ b/_test/_pip2.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +echo "🐍 pip" +echo "" +< 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 diff --git a/_test.sh b/_test/_test.sh similarity index 100% rename from _test.sh rename to _test/_test.sh diff --git a/_test/param.sh b/_test/param.sh new file mode 100755 index 0000000..0aa598c --- /dev/null +++ b/_test/param.sh @@ -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" ; diff --git a/update.sh b/_test/update.sh similarity index 100% rename from update.sh rename to _test/update.sh