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

48 lines
1.1 KiB
Bash
Raw Normal View History

#!/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
2024-03-25 21:06:05 -04:00
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