From e5229323927662996f6e757c3b3e48a9d1423b89 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Fri, 23 Feb 2024 22:41:42 -0500 Subject: [PATCH] refactor: move extras to files --- bootstrap.sh | 10 ++++++---- extras.vim => files/extras.vim | 0 git_config => files/git_config | 0 shell_extras => files/shell_extras | 0 4 files changed, 6 insertions(+), 4 deletions(-) rename extras.vim => files/extras.vim (100%) rename git_config => files/git_config (100%) rename shell_extras => files/shell_extras (100%) diff --git a/bootstrap.sh b/bootstrap.sh index 89e9fe7..ea98235 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -149,7 +149,7 @@ inject_shell_configuration() { echo "Setting up shell configuration extras..." if [[ -z $(cat $SHELL_CONFIG_PATH | grep $BLOCK_DELIMITER_PATTERN) ]]; then echo "# $BLOCK_DELIMITER_PATTERN\:start - source $WORKING_PATH/shell_extras + source $WORKING_PATH/files/shell_extras # $BLOCK_DELIMITER_PATTERN\:end" >> $SHELL_CONFIG_PATH echo "✅ Added managed block to $SHELL_CONFIG_PATH" else @@ -164,11 +164,13 @@ inject_shell_configuration() { inject_vim_configuration() { pre_step "Inject managed block in vim configuration" + WORKING_PATH=$(git rev-parse --show-toplevel) + if [[ -f $EDITOR_CONFIG_FILE ]]; then echo "Setting up NVIM configuration extras..." if [[ -z $(cat $EDITOR_CONFIG_FILE | grep $BLOCK_DELIMITER_PATTERN) ]]; then echo "\" $BLOCK_DELIMITER_PATTERN\:start - source $WORKING_PATH/extras.vim + source $WORKING_PATH/files/extras.vim \" $BLOCK_DELIMITER_PATTERN\:end\n\n" >> $EDITOR_CONFIG_FILE.new cat $EDITOR_CONFIG_FILE >> $EDITOR_CONFIG_FILE.new @@ -181,8 +183,8 @@ inject_vim_configuration() { fi echo "Setting up git configuration..." - source $WORKING_PATH/git_config - echo "✅ Set up git configuration, see $WORKING_PATH/git_config for details!" + source $WORKING_PATH/files/git_config + echo "✅ Set up git configuration, see $WORKING_PATH/files/git_config for details!" } ########################################################### diff --git a/extras.vim b/files/extras.vim similarity index 100% rename from extras.vim rename to files/extras.vim diff --git a/git_config b/files/git_config similarity index 100% rename from git_config rename to files/git_config diff --git a/shell_extras b/files/shell_extras similarity index 100% rename from shell_extras rename to files/shell_extras