added development environment setup scripts and pre-commit hook scripts
All checks were successful
Autotagger / Autotagger (push) Successful in 6s
Build / Export Files (push) Successful in 7s
Build / Documentation (push) Successful in 20s

This commit is contained in:
SeaswimmerTheFsh 2024-03-23 21:24:05 -04:00
parent 24582eb2fc
commit bdb43ef999
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
6 changed files with 106 additions and 0 deletions

45
scripts/dev.ps1 Executable file
View file

@ -0,0 +1,45 @@
# Function to install packwiz and add it to the system path
function Install-Packwiz {
# Download packwiz executable
Invoke-WebRequest -Uri "https://seafsh.cc/u/d4R3lH.exe" -OutFile "packwiz.exe"
# Move packwiz executable to a system directory
Move-Item -Path ".\packwiz.exe" -Destination "${env:ProgramFiles}\packwiz\packwiz.exe"
# Add packwiz directory to the system path
$path = [Environment]::GetEnvironmentVariable("Path", "Machine")
$packwizPath = "${env:ProgramFiles}\packwiz"
if ($path -notlike "*$packwizPath*") {
[Environment]::SetEnvironmentVariable("Path", "$path;$packwizPath", "Machine")
}
# Verify installation
& "${env:ProgramFiles}\packwiz\packwiz.exe" --version
}
# Function to create symlink for pre-commit hook
function Create-Symlink {
# Check if .git/hooks directory exists
$gitHooksDir = "$PSScriptRoot\.git\hooks"
if (-not (Test-Path $gitHooksDir)) {
Write-Error "Error: .git/hooks directory does not exist"
exit 1
}
# Create symlink for pre-commit hook
New-Item -ItemType SymbolicLink -Path "$gitHooksDir\pre-commit" -Target "$PSScriptRoot\scripts\hooks\pre-commit-windows" -Force
}
# Main function
function Main {
# Install packwiz
Install-Packwiz
# Create symlink for pre-commit hook
Create-Symlink
Write-Host "Script execution completed successfully!"
}
# Execute main function
Main

47
scripts/dev.sh Executable file
View file

@ -0,0 +1,47 @@
#!/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/pre-commit" "$(pwd)/.git/hooks/pre-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

5
scripts/hooks/pre-commit Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
echo "pre-commit: Refreshing packwiz"
cd src
packwiz refresh

View file

@ -0,0 +1,5 @@
#!/usr/bin/env/pwsh
Write-Output "pre-commit: Refreshing packwiz"
Set-Location src
packwiz refresh

2
scripts/unsup_setup.ps1 Normal file → Executable file
View file

@ -1,2 +1,4 @@
#!/usr/bin/env/pwsh
Invoke-WebRequest -OutFile unsup.jar -Uri https://git.sleeping.town/attachments/7edb17a2-e43f-4789-8bae-6140cbe98311
Invoke-WebRequest -OutFile unsup.ini -Uri https://www.coastalcommits.com/GalacticFactory/GalacticFactory/raw/branch/master/unsup.ini

2
scripts/unsup_setup.sh Normal file → Executable file
View file

@ -1,2 +1,4 @@
#!/bin/sh
wget -O unsup.jar https://git.sleeping.town/attachments/7edb17a2-e43f-4789-8bae-6140cbe98311
wget -O unsup.ini https://www.coastalcommits.com/GalacticFactory/GalacticFactory/raw/branch/master/unsup.ini