Add symlink test to bash files

This commit is contained in:
flyingscorpio@pinebook-pro 2020-04-11 10:24:58 +02:00
parent d6a125a1d9
commit 9b76a83169

View file

@ -136,7 +136,7 @@ install_scripts() { # {{{
separator
} # }}}
install_scripts
# install_scripts
update_vim() { # {{{
# Update vim configuration
@ -146,7 +146,7 @@ update_vim() { # {{{
separator
} # }}}
update_vim
# update_vim
setup_sddm() { # {{{
# Update sddm
@ -182,16 +182,32 @@ setup_bash_files() { # {{{
# Set up .bashrc
echo "Updating .bashrc..."
if [ ! -L ~/.bashrc ]; then
ln -rs "$BASE_DIR"/dotfiles/bash/bashrc ~/.bashrc 2> /dev/null
if [ ~/.bashrc -ef "$BASE_DIR"/dotfiles/bash/bashrc ]; then
echo "${GREEN}.bashrc points to the right location."
echo "Nothing changed.${NC}"
else
if [ "$OVERWRITE" = 'true' ]; then
rm ~/.bashrc 2> /dev/null
fi
if ln -rs "$BASE_DIR"/dotfiles/bash/bashrc ~/.bashrc; then
echo "${ORANGE}.bashrc symlink created${NC}"
fi
fi
separator
# Set up .bash_aliases
echo "Updating .bash_aliases..."
if [ ! -L ~/.bash_aliases ]; then
ln -rs "$BASE_DIR"/dotfiles/bash/bash_aliases ~/.bash_aliases 2> /dev/null
if [ ~/.bash_aliases -ef "$BASE_DIR"/dotfiles/bash/bash_aliases ]; then
echo "${GREEN}.bash_aliases points to the right location."
echo "Nothing changed.${NC}"
else
if [ "$OVERWRITE" = 'true' ]; then
rm ~/.bash_aliases 2> /dev/null
fi
if ln -rs "$BASE_DIR"/dotfiles/bash/bash_aliases ~/.bash_aliases; then
echo "${ORANGE}.bash_aliases symlink created${NC}"
fi
fi
separator
@ -233,7 +249,7 @@ install_rust() { # {{{
separator
} # }}}
install_rust
# install_rust
bash_git_prompt() { # {{{
# Clone bash-git-prompt
@ -251,7 +267,7 @@ bash_git_prompt() { # {{{
separator
} # }}}
bash_git_prompt
# bash_git_prompt
markdown_mimetype() { # {{{
# Add MIME type for reading .md files in Firefox (need to add extension too)
@ -271,7 +287,7 @@ markdown_mimetype() { # {{{
separator
} # }}}
markdown_mimetype
# markdown_mimetype
clone_projects() { # {{{
# Clone projects
@ -281,4 +297,4 @@ clone_projects() { # {{{
separator
} # }}}
clone_projects
# clone_projects