From abb61dade20e43a1a9a13d878b66863393670ccf Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sat, 1 Jul 2017 16:46:46 -0400 Subject: [PATCH] Updates symlinking script for custom emacs funcs --- emacs/symlink_custom_functions.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs/symlink_custom_functions.sh b/emacs/symlink_custom_functions.sh index 9effd9b10..292d4e3f7 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