This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
GalacticFactory-Legacy/scripts/dev.sh
Seaswimmer 8d3b945825
Some checks failed
Actions / Build and Upload Export Files (push) Failing after 7s
Actions / Autotagger (push) Successful in 8s
Actions / Build Documentation (push) Failing after 20s
made some modifications to the dev.sh script, to prevent redundant behavior
2024-06-09 15:57:46 -04:00

54 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# Function to install packwiz and add it to the system path
install_packwiz() {
# Download packwiz executable
wget https://seafsh.cc/u/O5JTlL -O 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
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
create_symlink() {
# Check if .git/hooks directory exists
if [ ! -d ".git/hooks" ]; then
echo "Error: .git/hooks directory does not exist"
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"
# Verify symlink creation
ls -l .git/hooks/post-commit
}
# Main function
main() {
# Install packwiz
install_packwiz
# Create symlink for pre-commit hook
create_symlink
echo "Development environment setup complete!"
}
# Execute main function
main