From 8559bc5508c0f528ced0999bf58bf3ef4aad1a49 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 4 Jun 2021 17:24:22 +0200 Subject: [PATCH] Refactor --- applydots.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applydots.sh b/applydots.sh index 0f5dee5..889805a 100755 --- a/applydots.sh +++ b/applydots.sh @@ -1,21 +1,24 @@ #!/usr/bin/sh applydots() { - cfgPath=$HOME/.config_test + cfgPath=$HOME/.config backupPath=$HOME/.config_backup curdate=$(date +"%Y-%m-%d-%T") + echo "Creating backup at \"$backupPath/$curdate\"..." mkdir -p $backupPath cp -r $cfgPath $backupPath/$curdate # create backup - + echo "Installing dotfiles..." # copy over the dotfiles cp -rf $PWD/.config/* $cfgPath/ + + echo "Done." } while true; do - read -p "Do you wish to install the dotfiles? (y/n) " yn + read -p "Do you wish to install the dotfiles? [yn] " yn case $yn in [Yy]* ) applydots; break;; [Nn]* ) exit;;