shell/install/dots
2025-01-17 19:07:28 +08:00

23 lines
646 B
Bash
Executable File

#!/usr/bin/env bash
##makedesc: Install dotfiles
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
title
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'`"
install_dotfile() {
mv "$HOME/$1" "$HOME/$1$postfix"
cp "$dotfiles_src_dir/$1" "$HOME/$1"
success "- $1"
}
install_dotfile ".bash_aliases" && \
install_dotfile ".profile" && \
install_dotfile ".bashrc" && \
install_dotfile ".gitconfig" && \
install_dotfile ".gitignore" && \
install_dotfile ".git_aliases"