From 9ca5cf3889b604e5624ef6e87d73177ac00f73cb Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 19 Jun 2018 22:27:21 -0400 Subject: [PATCH] Add an installation script. This now permits simpler installation and setup of my environment, when the core configuration is stored at `~/cshenv`. If stored elsewhere, the file would have to be edited. I'll think up an automatic solution to this later. --- startup_hooks/install.sh | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 startup_hooks/install.sh diff --git a/startup_hooks/install.sh b/startup_hooks/install.sh new file mode 100755 index 0000000..861cd02 --- /dev/null +++ b/startup_hooks/install.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +# Yeah, my CSHENV Install script is written in Bourne shell. This is because +# CSH isn't a great scripting language, but it is a nice interactive shell. + +export CSHENV_LOCATION="~/cshenv" + +echo "Checking for ~/.login" +if [ ! -e ~/.login ] +then + echo "Installing ~/.login" + echo "setenv CSHENV_DIR ${CSHENV_LOCATION}" >> ~/.login + echo 'source ${CSHENV_DIR}/startup_hooks/login' >> ~/.login +fi + +echo "Checking for ~/.tcshrc" +if [ ! -e ~/.tcshrc ] +then + echo "Installing ~/.tcshrc" + echo "setenv CSHENV_DIR ${CSHENV_LOCATION}" >> ~/.tcshrc + echo "setenv CSHENV_HIDE_SHELL_LEVEL_AT_ONE" >> ~/.tcshrc + echo 'source ${CSHENV_DIR}/startup_hooks/tcshrc' >> ~/.tcshrc +fi + +echo "Checking for vim setup" +if [ -e ~/.vimrc ] +then + echo "Relocating vimrc" + mv ~/.vimrc ~/.vim/vimrc.old +fi + +if [ -e ~/.vim ] +then + echo "Relocating vim setup" + mv ~/.vim ~/.vim.old +fi + +echo "Installing vim setup" +ln -s ${CSHENV_DIR}/vim ~/.vim + +if [ -e ~/.gitconfig ] +then + echo "Relocating git setup" + mv ~/.gitconfig ~/.gitconfig-old +fi + +echo "Installing git configuration" + +echo "[include]" >> ~/.gitconfig +echo " path = ${CSHENV_LOCATION}/git/gitconfig" >> ~/.gitconfig +echo "" >> ~/.gitconfig + +echo "[user]" >> ~/.gitconfig +echo " email = adam@recursive.engineer" >> ~/.gitconfig +echo " name = ADAM David Alan Martin" >> ~/.gitconfig +echo "" >> ~/.gitconfig +echo " signingKey = \"`hostname` Git\"" >> ~/.gitconfig + +echo "" >> ~/.gitconfig +echo "[commit]" >> ~/.gitconfig +echo " gpgSign = true" >> ~/.gitconfig