|
|
@ -1,21 +1,24 @@ |
|
|
|
#!/usr/bin/sh |
|
|
|
#!/usr/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
applydots() { |
|
|
|
applydots() { |
|
|
|
cfgPath=$HOME/.config_test |
|
|
|
cfgPath=$HOME/.config |
|
|
|
backupPath=$HOME/.config_backup |
|
|
|
backupPath=$HOME/.config_backup |
|
|
|
|
|
|
|
|
|
|
|
curdate=$(date +"%Y-%m-%d-%T") |
|
|
|
curdate=$(date +"%Y-%m-%d-%T") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Creating backup at \"$backupPath/$curdate\"..." |
|
|
|
mkdir -p $backupPath |
|
|
|
mkdir -p $backupPath |
|
|
|
cp -r $cfgPath $backupPath/$curdate # create backup |
|
|
|
cp -r $cfgPath $backupPath/$curdate # create backup |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installing dotfiles..." |
|
|
|
# copy over the dotfiles |
|
|
|
# copy over the dotfiles |
|
|
|
cp -rf $PWD/.config/* $cfgPath/ |
|
|
|
cp -rf $PWD/.config/* $cfgPath/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Done." |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
while true; do |
|
|
|
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 |
|
|
|
case $yn in |
|
|
|
[Yy]* ) applydots; break;; |
|
|
|
[Yy]* ) applydots; break;; |
|
|
|
[Nn]* ) exit;; |
|
|
|
[Nn]* ) exit;; |
|
|
|