diff --git a/install_bashrc.sh b/install_bashrc.sh new file mode 100755 index 0000000..59e2f40 --- /dev/null +++ b/install_bashrc.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +ask_yes_no () { + msg="$1" + + echo -n "${msg} [Y/n]: " + + read ans + + case $ans in + "[Yy]" | "[Yy]es" | "" ) + return 0 + ;; + + * ) + return 1 + ;; + esac +} + + +if ask_yes_no "CAUTION: This script will break current '.bashrc' if it exists. Is it OK?"; then + cat <<"EOF" > "${HOME}/.bashrc" +SHELL_ENV="${HOME}/env/shell-env" + +source "${SHELL_ENV}/bashrc.sh" +EOF + + echo "${HOME}/.bashrc is created." +fi diff --git a/install_zshrc.sh b/install_zshrc.sh new file mode 100755 index 0000000..2c4cad8 --- /dev/null +++ b/install_zshrc.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +ask_yes_no () { + msg="$1" + + echo -n "${msg} [Y/n]: " + + read ans + + case $ans in + "[Yy]" | "[Yy]es" | "" ) + return 0 + ;; + + * ) + return 1 + ;; + esac +} + + +if ask_yes_no "CAUTION: This script will break current '.zshrc' if it exists. Is it OK?"; then + cat <<"EOF" > "${HOME}/.zshrc" +SHELL_ENV="${HOME}/env/shell-env" + +source "${SHELL_ENV}/zshrc.sh" +EOF + + echo "${HOME}/.zshrc is created." +fi