shell/install/dots

23 lines
599 B
Plaintext
Raw Normal View History

2022-10-08 04:37:00 +00:00
#!/bin/bash
##makedesc: Install dotfiles
2023-04-14 04:06:40 +00:00
source `dirname $0`/../helpers || exit 255
2022-10-08 04:37:00 +00:00
2023-04-14 04:06:40 +00:00
title
2022-10-08 04:37:00 +00:00
install_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dotfiles_src_dir="`dirname $install_dir`/dotfiles"
postfix=".bak-`date '+%Y%m%d%H%M'`"
2023-04-14 04:06:40 +00:00
install_dotfile() {
mv "$HOME/$1" "$HOME/$1$postfix"
cp "$dotfiles_src_dir/$1" "$HOME/$1"
success "- $1"
2022-10-08 04:37:00 +00:00
}
2023-04-14 04:06:40 +00:00
install_dotfile ".bash_aliases" && \
install_dotfile ".profile" && \
install_dotfile ".bashrc" && \
install_dotfile ".gitconfig" && \
install_dotfile ".gitignore" && \
install_dotfile ".git_aliases"