From a4c0d4826d86c3e7d201a051c2567fd84caa7f3f Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 22 Dec 2022 21:41:34 -0800 Subject: [PATCH] Move post-setup scripts to their own directory --- diff-highlight.sh => post-setup/diff-highlight.sh | 0 gpg.sh => post-setup/gpg.sh | 0 ssh.sh => post-setup/ssh.sh | 2 +- vscode.sh => post-setup/vscode.sh | 2 +- setup.sh | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename diff-highlight.sh => post-setup/diff-highlight.sh (100%) rename gpg.sh => post-setup/gpg.sh (100%) rename ssh.sh => post-setup/ssh.sh (84%) rename vscode.sh => post-setup/vscode.sh (95%) diff --git a/diff-highlight.sh b/post-setup/diff-highlight.sh similarity index 100% rename from diff-highlight.sh rename to post-setup/diff-highlight.sh diff --git a/gpg.sh b/post-setup/gpg.sh similarity index 100% rename from gpg.sh rename to post-setup/gpg.sh diff --git a/ssh.sh b/post-setup/ssh.sh similarity index 84% rename from ssh.sh rename to post-setup/ssh.sh index 8877b02..32b4e6f 100755 --- a/ssh.sh +++ b/post-setup/ssh.sh @@ -8,7 +8,7 @@ fi # set 0600 permissions on config file # (setting permissions on a symlink does nothing; see chmod(1)) -chmod 0600 "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )/src/.ssh/config" +chmod 0600 "${DIR}/src/.ssh/config" # prompt to create key if none exists if [[ "$(find ~/.ssh -maxdepth 1 -type f -name '*.pub' | wc -l)" == 0 ]]; then diff --git a/vscode.sh b/post-setup/vscode.sh similarity index 95% rename from vscode.sh rename to post-setup/vscode.sh index da39daf..201f704 100755 --- a/vscode.sh +++ b/post-setup/vscode.sh @@ -45,7 +45,7 @@ done < "$DIR"/vscode/extensions # backup settings/keybinds files, then create symlinks # TODO: do the same for snippets dir files for file in settings.json keybindings.json; do - source="$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )/vscode/$file" + source="${DIR}/vscode/$file" target="$VSCODE_CONFIG_PATH/$file" if [[ -h "$target" ]] && [[ "$source" == "$(readlink -f "$target")" ]]; then echo "Skipping '$source' -> '$target' link as it is already linked" diff --git a/setup.sh b/setup.sh index deb6d1e..0f62ebf 100755 --- a/setup.sh +++ b/setup.sh @@ -75,5 +75,5 @@ elif [ $remove -eq 0 ]; then fi for script in "${POST_SETUP_SCRIPTS[@]}"; do - source "${DIR}/${script}" + source "${DIR}/post-setup/${script}" done