Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions install_bashrc.sh
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions install_zshrc.sh
Original file line number Diff line number Diff line change
@@ -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