Updated README and another small bug fix
This commit is contained in:
parent
d31d19e80c
commit
78c7bbe346
11
README.md
11
README.md
@ -3,10 +3,17 @@
|
||||
|
||||
This is a collection of all the files that I want very easily available on any new machine that I sit down at. The install script is designed to be run either from the cloned repository or as a stand-alone script through curl. See the usage details for examples.
|
||||
|
||||
WARNING
|
||||
-------
|
||||
|
||||
The install script provided with these dotfiles is destructive and will overwrite files without asking. To ensure that you do not lose anything important please backup your .bashrc, .gitconfig, .gitignore, .inputrc, .tmux.conf, and .vimrc files in your home directory.
|
||||
|
||||
I can not be held responsible if you lose any important data.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
** Method 1 **
|
||||
**Method 1**
|
||||
|
||||
The first method requires cloning the repository and running the install script manually.
|
||||
|
||||
@ -14,7 +21,7 @@
|
||||
cd ~/.dotfiles
|
||||
./install.sh
|
||||
|
||||
** Method 2 **
|
||||
**Method 2**
|
||||
|
||||
The second method does not require cloning the repository however it does require that Git and Curl is installed on the target machine.
|
||||
|
||||
|
25
install.sh
25
install.sh
@ -45,8 +45,8 @@ function performSetup() {
|
||||
fi
|
||||
home=${1}
|
||||
|
||||
echo "Moving to Home directory...";
|
||||
pushd ${home};
|
||||
echo "Moving to Home directory..."
|
||||
pushd ${home} > /dev/null
|
||||
|
||||
echo "Adding id_rsa.pub to authorized keys if necessary"
|
||||
if [ ! -d .ssh ]; then
|
||||
@ -54,29 +54,29 @@ function performSetup() {
|
||||
fi
|
||||
if [ ! -e ".ssh/authorized_keys" ]; then
|
||||
cp ${REPO_DIR}/.ssh/id_rsa.pub .ssh/authorized_keys
|
||||
elif ! grep -q `cat ${REPO_DIR}/.ssh/id_rsa.pub` ".ssh/authorized_keys"; then
|
||||
elif ! grep -f ${REPO_DIR}/.ssh/id_rsa.pub .ssh/authorized_keys; then
|
||||
cat ${REPO_DIR}/.ssh/id_rsa.pub >> .ssh/authorized_keys
|
||||
fi
|
||||
|
||||
echo "Linking shell configs...";
|
||||
echo "Linking shell configs..."
|
||||
linkFile ".bashrc"
|
||||
|
||||
echo "Linking vim...";
|
||||
echo "Linking vim..."
|
||||
linkFile ".vimrc"
|
||||
createDirectory ".vim"
|
||||
createDirectory ".vim/swaps"
|
||||
createDirectory ".vim/backups"
|
||||
|
||||
echo "Linking Git...";
|
||||
echo "Linking Git..."
|
||||
linkFile ".gitconfig"
|
||||
|
||||
echo "Linking tmux...";
|
||||
echo "Linking tmux..."
|
||||
linkFile ".tmux.conf"
|
||||
|
||||
echo "Linking inputrc..."
|
||||
linkFile ".inputrc"
|
||||
|
||||
popd
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@ -110,12 +110,13 @@ else
|
||||
fi
|
||||
|
||||
# Clone the repository into current location using readonly url.
|
||||
echo "Cloning dotfiles repository to ${HOME}/.dotfiles"
|
||||
if [ -d ${HOME}/.dotfiles ]; then
|
||||
pushd ${HOME}/.dotfiles
|
||||
git pull
|
||||
popd
|
||||
echo "Updating dotfiles repository in ${HOME}/.dotfiles"
|
||||
pushd ${HOME}/.dotfiles > /dev/null
|
||||
git pull > /dev/null
|
||||
popd > /dev/null
|
||||
else
|
||||
echo "Cloning dotfiles repository to ${HOME}/.dotfiles"
|
||||
git clone https://github.com/tgrosinger/dotfiles.git ${HOME}/.dotfiles
|
||||
fi
|
||||
REPO_DIR="${HOME}/.dotfiles"
|
||||
|
Loading…
Reference in New Issue
Block a user