about summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-07-01T20·46-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-07-01T20·46-0400
commitabb61dade20e43a1a9a13d878b66863393670ccf (patch)
tree8599b8dc5c1bfba7844132a72e4da5bb93b6e5d9 /emacs
parent296fe1b8f671e4fda2fc6b37b63dcbba399b21aa (diff)
Updates symlinking script for custom emacs funcs
Diffstat (limited to 'emacs')
-rwxr-xr-xemacs/symlink_custom_functions.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/emacs/symlink_custom_functions.sh b/emacs/symlink_custom_functions.sh
index 9effd9b1058b..292d4e3f7492 100755
--- a/emacs/symlink_custom_functions.sh
+++ b/emacs/symlink_custom_functions.sh
@@ -1,3 +1,18 @@
 #!/usr/bin/env zsh
 
-ln -s ~/pc_settings/emacs/*.el ~/.emacs.d/
+SCRIPT_DIR="$HOME/pc_settings/emacs"
+EMACS_FUNC_DIR="$HOME/.emacs.d"
+
+for source in $(find $SCRIPT_DIR -type f -name '*.el'); do
+  filename=$(basename $source)
+  target="${EMACS_FUNC_DIR}/${filename}"
+
+  if [ ! -L $target ]; then
+    echo -n "Creating symlink for ${filename} ... " && \
+    ln -s $source $EMACS_FUNC_DIR && \
+    echo "Done."
+  else
+    echo "${filename} is already properly symlinked."
+  fi
+
+done