summaryrefslogtreecommitdiff
path: root/tools/install-defaults
diff options
context:
space:
mode:
Diffstat (limited to 'tools/install-defaults')
-rwxr-xr-xtools/install-defaults24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/install-defaults b/tools/install-defaults
new file mode 100755
index 0000000..f7b75d0
--- /dev/null
+++ b/tools/install-defaults
@@ -0,0 +1,24 @@
+#!/bin/zsh
+
+for DF in ~/.resources/default-dotfiles/*[^~]; do
+ SDF=$(echo $(basename $DF) | sed -e's@__@/@g')
+ DOTNAME=~/.${SDF}
+ DIROF=$(dirname $DOTNAME)
+ mkdir -p $DIROF
+ if [ ! -e $DOTNAME ]; then
+ echo Installing $DOTNAME
+ cp $DF $DOTNAME
+ else
+ cmp -s $DF $DOTNAME
+ if [ "$?" != "0" ]; then
+ echo "$DOTNAME has changed:"
+ diff -u $DOTNAME $DF
+ echo "Apply changes [Y/n]?"
+ read FOO
+ if [ "x$FOO" = "xy" -o "x$FOO" = "x" ]; then
+ cp $DF $DOTNAME
+ fi
+ fi
+ fi
+done
+