aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorJacob Janzen <jjanzenn@proton.me>2024-08-07 15:23:16 -0500
committerJacob Janzen <jjanzenn@proton.me>2024-08-07 15:23:16 -0500
commit24ed1e1e952716d06d994f383d7e92661cf362a9 (patch)
treec61beef8ec0991c162b7be88f9cba5d5c36766c7 /install
parent5f28612db307ac8ad3d7602afe0081acbf92e257 (diff)
name update-home install in the repo
Diffstat (limited to 'install')
-rwxr-xr-xinstall31
1 files changed, 31 insertions, 0 deletions
diff --git a/install b/install
new file mode 100755
index 0000000..19e2191
--- /dev/null
+++ b/install
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# install the dotfiles source if it is not present
+if ! test -d ~/.dotfiles; then
+ echo Installing dotfiles...
+ git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles
+fi
+
+# save the current working directory and move to the dotfiles repository
+CWD=$(pwd)
+cd ~/.dotfiles || exit
+git stash
+git checkout main
+git pull --rebase
+
+# Install new install script and run it instead of this
+if ! diff ~/.dotfiles/install ~/.local/bin/update-home; then
+ cp ~/.dotfiles/install ~/.local/bin/update-home || exit 1
+ echo Changes have been made to the install script.
+ echo Running the new install script.
+ ~/.local/bin/update-home
+ exit
+fi
+
+# install config files
+find -- * -type f -name "*.org" | while read -r file; do
+ echo Installing "${file}" configuration...
+ # emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)'
+done
+
+cd "${CWD}" || exit