shell/install/dots

23 lines
646 B
Plaintext
Raw Normal View History

2025-01-17 19:07:28 +08:00
#!/usr/bin/env bash
2022-10-08 12:37:00 +08:00
##makedesc: Install dotfiles
2024-11-24 21:13:37 +08:00
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
2022-10-08 12:37:00 +08:00
2024-07-31 23:37:18 +08:00
title
2022-10-08 12:37:00 +08: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'`"
2024-07-31 23:37:18 +08:00
install_dotfile() {
mv "$HOME/$1" "$HOME/$1$postfix"
cp "$dotfiles_src_dir/$1" "$HOME/$1"
success "- $1"
2022-10-08 12:37:00 +08:00
}
2024-07-31 23:37:18 +08:00
install_dotfile ".bash_aliases" && \
install_dotfile ".profile" && \
install_dotfile ".bashrc" && \
install_dotfile ".gitconfig" && \
install_dotfile ".gitignore" && \
install_dotfile ".git_aliases"