From 8d3b945825f30caeda9fc4a270b963f9e1412e1a Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Sun, 9 Jun 2024 15:57:46 -0400 Subject: [PATCH] made some modifications to the `dev.sh` script, to prevent redundant behavior --- scripts/dev.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/dev.sh b/scripts/dev.sh index 7c07425..7a70f39 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -7,14 +7,18 @@ install_packwiz() { # Move packwiz executable to a system directory (you may need sudo) sudo mv packwiz /usr/local/bin/packwiz + sudo chmod +x /usr/local/bin/packwiz + sudo chmod 111 /usr/local/bin/packwiz # Add packwiz to the system path - echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc - source ~/.bashrc + if [[ ! ":$PATH:" == *":/usr/local/bin:"* ]]; then + echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc + fi # Generate autocompletion script packwiz completion bash > ~/.packwiz echo 'source ~/.packwiz' >> ~/.bashrc + source ~/.bashrc } # Function to create symlink for pre-commit hook @@ -25,6 +29,9 @@ create_symlink() { exit 1 fi + # Delete old symlink + rm -f "$(pwd)/.git/hooks/post-commit" + # Create symlink for pre-commit hook ln -s "$(pwd)/scripts/hooks/post-commit" "$(pwd)/.git/hooks/post-commit"