From def4f6761adb33489a60ba7d61e2ebe3b8ce1b14 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Wed, 31 Jul 2024 23:37:18 +0800 Subject: [PATCH] dotfiles misc --- install/dots | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/install/dots b/install/dots index 88e9b94..1806089 100755 --- a/install/dots +++ b/install/dots @@ -1,25 +1,22 @@ #!/bin/bash ##makedesc: Install dotfiles +source `dirname $0`/../helpers || exit 255 -echo -echo "===============================================" -echo "Installing dotfiles..." -echo "===============================================" -echo +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() { - echo "mv "$HOME/$1" "$HOME/$1$postfix"" - echo "cp "$dotfiles_src_dir/$1" "$HOME/$1"" - echo "- $1" +install_dotfile() { + mv "$HOME/$1" "$HOME/$1$postfix" + cp "$dotfiles_src_dir/$1" "$HOME/$1" + success "- $1" } -install .bash_aliases -install .profile -install .bashrc -install .gitconfig -install .gitignore -install .git_aliases +install_dotfile ".bash_aliases" && \ + install_dotfile ".profile" && \ + install_dotfile ".bashrc" && \ + install_dotfile ".gitconfig" && \ + install_dotfile ".gitignore" && \ + install_dotfile ".git_aliases"