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
SeaswimmerTheFsh 17fbcfe654
All checks were successful
Autotagger / Autotagger (push) Successful in 6s
Build / Export Files (push) Successful in 7s
Build / Documentation (push) Successful in 18s
made the pre-commit hook a post-commit hook
2024-03-24 04:32:29 -04:00

47 lines
1.1 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
# Add packwiz to the system path
echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc
source ~/.bashrc
# Generate autocompletion script
packwiz completion bash > ~/.packwiz
echo 'source ~/.packwiz' >> ~/.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
# 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/pre-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