From b4ece3743b10a2ebbfbeb816c89613aa45fef2c3 Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 6 May 2014 17:12:33 +0300 Subject: [PATCH] bashrc & zshrc: add function shell-things. Closes #21. --- .install.MKAYSIGREP.run | 1 + bashrc | 49 +++++++++++++++++++++++++++++++++++++++++ zshrc | 49 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) diff --git a/.install.MKAYSIGREP.run b/.install.MKAYSIGREP.run index 952446b6..9cc16a56 100755 --- a/.install.MKAYSIGREP.run +++ b/.install.MKAYSIGREP.run @@ -26,4 +26,5 @@ cat chmod > ~/chmod cat wwwuser > ~/wwwuser chmod a+xr ~/chmod chmod a+r ~/wwwuser +touch ~/.MKAYSIGREP # vim : set ft=sh : diff --git a/bashrc b/bashrc index aaf886f5..7daa19ea 100644 --- a/bashrc +++ b/bashrc @@ -644,6 +644,55 @@ function gribble-gpg-everify() { rm -rf bitcoin_otc.txt bitcoin_otc.txt.asc } +# This function will install/upgrade shell-things. + +function shell-things { + +export SHELL_THINGS_REPO=$HOME/.shell-things +export MKAYSIGREP=$HOME/.MKAYSIGREP + +# Check if ~/.shell-things exists and cd and pull. +if [ -d $SHELL_THINGS_REPO ]; then + echo "shell-things: $SHELL_THINGS_REPO exists, git pulling..." + echo "" + cd $SHELL_THINGS_REPO + git pull + echo "" + echo "shell-things: Installing/Upgrading..." + echo "" +# If it doesn't exist... +else + echo "" + echo "shell-things: $SHELL_THINGS_REPO doesn't exist, cloning..." + echo "" + git clone https://github.com/Mkaysi/shell-things.git $SHELL_THINGS_REPO + cd $SHELL_THINGS_REPO + echo "" + echo "shell-things: Installing/Upgrading..." + echo "" +fi + +# Installing... +./install.run +echo "" +echo "shell-things: Installing finished." +echo "" + +#If ~/.MKAYSIGREP exists, run that script too... +if [ -f "$MKAYSIGREP" ]; then + echo "MKAYSIGREP has been used previously, Installing/Upgrading." + ./.install.MKAYSIGREP.run +fi + +echo "" +echo "shell-things: Everthing is now done :)" +echo "" + +cd + +} + + # .custom if [ -f ~/.custom ]; then source ~/.custom diff --git a/zshrc b/zshrc index 56e9ff78..3e405c99 100644 --- a/zshrc +++ b/zshrc @@ -616,6 +616,55 @@ function gribble-gpg-everify() { rm -rf bitcoin_otc.txt bitcoin_otc.txt.asc } +# This function will install/upgrade shell-things. + +function shell-things { + +export SHELL_THINGS_REPO=$HOME/.shell-things +export MKAYSIGREP=$HOME/.MKAYSIGREP + +# Check if ~/.shell-things exists and cd and pull. +if [ -d $SHELL_THINGS_REPO ]; then + echo "shell-things: $SHELL_THINGS_REPO exists, git pulling..." + echo "" + cd $SHELL_THINGS_REPO + git pull + echo "" + echo "shell-things: Installing/Upgrading..." + echo "" +# If it doesn't exist... +else + echo "" + echo "shell-things: $SHELL_THINGS_REPO doesn't exist, cloning..." + echo "" + git clone https://github.com/Mkaysi/shell-things.git $SHELL_THINGS_REPO + cd $SHELL_THINGS_REPO + echo "" + echo "shell-things: Installing/Upgrading..." + echo "" +fi + +# Installing... +./install.run +echo "" +echo "shell-things: Installing finished." +echo "" + +#If ~/.MKAYSIGREP exists, run that script too... +if [ -f "$MKAYSIGREP" ]; then + echo "MKAYSIGREP has been used previously, Installing/Upgrading." + ./.install.MKAYSIGREP.run +fi + +echo "" +echo "shell-things: Everthing is now done :)" +echo "" + +cd + +} + + # Source files for miscannellious modifications. # .custom