diff options
author | Urbain Vaes <urbain@vaes.uk> | 2015-05-08 14:56:42 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2015-05-08 14:56:42 +0100 |
commit | 5882a654b34f4d263809b0147065d9aabcf5d3c7 (patch) | |
tree | 6f406d6ee8af3d0673d905576454b2ff3a5d1a61 | |
parent | c5ff5f6dd8bb885894ad10e10970406aad6559db (diff) |
added arguments in install.sh
-rwxr-xr-x | install.sh (renamed from make) | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,6 @@ #!/bin/bash + dir=~/dotfiles olddir=~/dotfiles_old @@ -8,8 +9,14 @@ mkdir -p $olddir echo -e "\n*** Symlinking files *** \n" +if [ $# -eq 0 ]; then + listFiles=`ls --ignore="make" --ignore="tex"` +else + listFiles=$@ +fi + cd $dir -for file in `ls --ignore="make" --ignore="tex"`; do +for file in $listFiles; do if [ -e ~/.$file ]; then mv ~/.$file $olddir printf '~/.%-15s exists. ' $file @@ -19,12 +26,15 @@ for file in `ls --ignore="make" --ignore="tex"`; do echo "(Re)-creating symbolic link of $file." done +if [ $# -ne 0 ]; then + exit +fi + # Symlink for neovim rm ~/.nvim ~/.nvimrc ln -s $dir/vim ~/.nvim ln -s $dir/vimrc ~/.nvimrc - echo -e "\n*** Updating/Creating git repositories *** \n" declare -A repos |