VT_Player/scripts/build.sh
Stu Leak ce60508480 Add build/run scripts and fix DVD options visibility
Added scripts folder with three convenience scripts:
  • scripts/build.sh - Clean build with dependency verification
  • scripts/run.sh - Run application (auto-builds if needed)
  • scripts/alias.sh - Create 'VideoTools' command alias

Usage:
  source scripts/alias.sh
  VideoTools              # Run app
  VideoToolsRebuild       # Force rebuild
  VideoToolsClean         # Clean artifacts

Fixed main.go DVD options:
  • Fixed callback ordering so updateDVDOptions is called on format selection
  • DVD aspect ratio selector now appears when DVD format is selected
  • DVD info display shows specs for NTSC and PAL formats
  • Works in both Simple and Advanced tabs

DVD options are now fully functional in the UI.
2025-11-29 19:53:47 -05:00

62 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# VideoTools Build Script
# Cleans dependencies and builds the application with proper error handling
set -e
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_OUTPUT="$PROJECT_ROOT/VideoTools"
echo "════════════════════════════════════════════════════════════════"
echo " VideoTools Build Script"
echo "════════════════════════════════════════════════════════════════"
echo ""
# Check if go is installed
if ! command -v go &> /dev/null; then
echo "❌ ERROR: Go is not installed. Please install Go 1.21 or later."
exit 1
fi
echo "📦 Go version:"
go version
echo ""
# Change to project directory
cd "$PROJECT_ROOT"
echo "🧹 Cleaning previous builds and cache..."
go clean -cache -modcache -testcache 2>/dev/null || true
rm -f "$BUILD_OUTPUT" 2>/dev/null || true
echo "✓ Cache cleaned"
echo ""
echo "⬇️ Downloading and verifying dependencies..."
go mod download
go mod verify
echo "✓ Dependencies verified"
echo ""
echo "🔨 Building VideoTools..."
if CGO_ENABLED=0 go build -o "$BUILD_OUTPUT" .; then
echo "✓ Build successful!"
echo ""
echo "════════════════════════════════════════════════════════════════"
echo "✅ BUILD COMPLETE"
echo "════════════════════════════════════════════════════════════════"
echo ""
echo "Output: $BUILD_OUTPUT"
echo "Size: $(du -h "$BUILD_OUTPUT" | cut -f1)"
echo ""
echo "To run:"
echo " $PROJECT_ROOT/VideoTools"
echo ""
echo "Or use the convenience script:"
echo " source $PROJECT_ROOT/scripts/alias.sh"
echo " VideoTools"
echo ""
else
echo "❌ Build failed!"
exit 1
fi