From 65ca7e2ad84f0892ef13a3c67c62253834db8794 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 4 Jun 2021 17:21:07 +0200 Subject: [PATCH] Added applydots.sh --- applydots.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 applydots.sh diff --git a/applydots.sh b/applydots.sh new file mode 100755 index 0000000..0f5dee5 --- /dev/null +++ b/applydots.sh @@ -0,0 +1,24 @@ +#!/usr/bin/sh + +applydots() { + cfgPath=$HOME/.config_test + backupPath=$HOME/.config_backup + + curdate=$(date +"%Y-%m-%d-%T") + + mkdir -p $backupPath + cp -r $cfgPath $backupPath/$curdate # create backup + + + # copy over the dotfiles + cp -rf $PWD/.config/* $cfgPath/ +} + +while true; do + read -p "Do you wish to install the dotfiles? (y/n) " yn + case $yn in + [Yy]* ) applydots; break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac +done