aboutsummaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-12-05 01:39:05 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-12-05 01:39:05 +0100
commite9f52f24c29f798d618c6e8e68ceabbd86bd0c6c (patch)
tree95f88e910ec3388d82c5e3814f0c2cb6f6c4b49c /hooks
parent05280ce5c09fea7f9e9bdddb69e3d21b8debe088 (diff)
downloaddotfiles-e9f52f24c29f798d618c6e8e68ceabbd86bd0c6c.tar.gz
hooks!
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/housekeeping.hook14
1 files changed, 14 insertions, 0 deletions
diff --git a/hooks/housekeeping.hook b/hooks/housekeeping.hook
new file mode 100755
index 0000000..7fc77a9
--- /dev/null
+++ b/hooks/housekeeping.hook
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+git submodule init
+git submodule update
+
+#.files is used to tell scripts where to look for the dotfiles
+[ -f "$HOME/.files" ] && source "$HOME/.files"
+if [ "$DOTFILEBASE" != "$(pwd)" ] && yes_no "'.files' out of date. Regenerate?"; then
+ echo "DOTFILEBASE=\"$(pwd)\"" > $HOME/.files
+fi
+
+if [ ! -f "$HOME/.files.config" ] && yes_no ".files.config does not exist. Populate with defaults?"; then
+ cp "config.default" "$HOME/.files.config"
+fi