diff options
author | Matt Kohls <mattkohls13@gmail.com> | 2017-02-06 16:28:03 -0500 |
---|---|---|
committer | Matt Kohls <mattkohls13@gmail.com> | 2017-02-06 16:28:03 -0500 |
commit | 44b0e46635aa92559aa037b7acc5a44798fb0d4a (patch) | |
tree | c0b4d64d17043c18bb1b0e3579b5ebc042732ed0 | |
parent | 5addc47d17a93ed31ab14bc5242a6695ce3671f9 (diff) | |
download | dotfiles-44b0e46635aa92559aa037b7acc5a44798fb0d4a.tar.gz dotfiles-44b0e46635aa92559aa037b7acc5a44798fb0d4a.tar.bz2 dotfiles-44b0e46635aa92559aa037b7acc5a44798fb0d4a.zip |
Changing to make script work from any directory
-rwxr-xr-x | linker.sh | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,12 +1,17 @@ #!/bin/bash +# Matt Kohls 2017 +# License GPLv3 or later + +# Save dir of where we start from to link back to +DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd ~ # Start with .bashrc if [[ -e .bashrc ]] ; then cp .bashrc .bashrc.original fi -ln -s ~/dotfiles/.bashrc ~/.bashrc +ln -s $DIR/.bashrc ~/.bashrc # Next .vim(rc) if [[ -e .vimrc ]] ; then @@ -15,8 +20,8 @@ fi if [[ -e .vim ]] ; then cp -r .vim .vim.original fi -ln -s ~/dotfiles/.vimrc ~/.vimrc -ln -s ~/dotfiles/.vim ~/.vim +ln -s $DIR/.vimrc ~/.vimrc +ln -s $DIR/.vim ~/.vim # Next .git if [[ -e .gitconfig ]] ; then @@ -25,6 +30,6 @@ fi if [[ -e .gitignore_global ]] ; then cp .gitignore_global .gitignore_global.original fi -ln -s ~/dotfiles/.gitconfig ~/.gitconfig -ln -s ~/dotfiles/.gitignore_global .gitignore_global +ln -s $DIR/.gitconfig ~/.gitconfig +ln -s $DIR/.gitignore_global .gitignore_global |