From bc9eb794a8fee2637f3c601f32025f39290473ec Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Oct 2022 12:37:00 +0800 Subject: [PATCH] Dotfiles installer --- Makefile | 6 +++++- install/dots | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 install/dots diff --git a/Makefile b/Makefile index 1d4ec20..a1f68f5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Autogenerated at 05.10.2022 11:23 using ./gen-makefile +# Autogenerated at 08.10.2022 12:36 using ./gen-makefile .DEFAULT_GOAL := help #=============================================== @@ -50,6 +50,10 @@ composer-clean: docker: @./install/docker +# Install dotfiles +dots: + @./install/dots + # Install droidcam v1.8.2 droidcam: @./install/droidcam diff --git a/install/dots b/install/dots new file mode 100755 index 0000000..40a2d3b --- /dev/null +++ b/install/dots @@ -0,0 +1,24 @@ +#!/bin/bash +##makedesc: Install dotfiles + +echo +echo "===============================================" +echo "Installing dotfiles..." +echo "===============================================" +echo + +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 .bash_aliases +install .profile +install .gitconfig +install .gitignore +install .git_aliases