diff --git a/go.mod b/go.mod index 4fbd040..29a5de1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module git.sovbit.dev/enki/torrentGateway -go 1.24 +go 1.24.1 + +toolchain go1.24.4 require ( github.com/anacrolix/torrent v1.58.1 diff --git a/scripts/install_native.sh b/scripts/install_native.sh index 77cb995..d5c7a8e 100755 --- a/scripts/install_native.sh +++ b/scripts/install_native.sh @@ -8,6 +8,9 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +# Ensure we're in the project root +cd "$PROJECT_ROOT" + echo "🚀 Torrent Gateway Native Installation" echo "======================================" @@ -21,6 +24,12 @@ fi # Parse arguments ENABLE_MONITORING=false SKIP_BUILD=false + +# Check if binary already exists and skip build if so +if [ -f "bin/gateway" ]; then + echo "✅ Found existing binary at bin/gateway - skipping build" + SKIP_BUILD=true +fi DOMAIN="" EMAIL="" SKIP_SSL=false @@ -185,29 +194,14 @@ echo "✅ Go $GO_VERSION installed" if [ "$SKIP_BUILD" = false ]; then echo "🔨 Building Torrent Gateway..." - # Debug: Show environment and current directory - echo "DEBUG: Current working directory: $(pwd)" - echo "DEBUG: GOPATH: ${GOPATH:-'not set'}" - echo "DEBUG: GOROOT: ${GOROOT:-'not set'}" - echo "DEBUG: Contents of current directory:" - ls -la | head -10 - echo "DEBUG: Check if cmd/gateway exists:" - if [ -d "cmd/gateway" ]; then - echo " ✅ cmd/gateway directory exists" - ls -la cmd/gateway/ - else - echo " ❌ cmd/gateway directory does NOT exist" - fi - # Install Go dependencies go mod download # Create bin directory if it doesn't exist mkdir -p bin - # Build binary with verbose output - echo "DEBUG: Running go build command..." - go build -v -o bin/gateway \ + # Build binary + go build -o bin/gateway \ -ldflags "-X main.version=$(git describe --tags --always 2>/dev/null || echo 'dev') -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \ ./cmd/gateway diff --git a/scripts/setup_systemd.sh b/scripts/setup_systemd.sh index edeef70..b317a9c 100755 --- a/scripts/setup_systemd.sh +++ b/scripts/setup_systemd.sh @@ -49,17 +49,6 @@ done cd "$PROJECT_ROOT" -# Debug: print current directory and check if cmd/gateway exists -echo "DEBUG: Current directory: $(pwd)" -echo "DEBUG: Contents of current directory:" -ls -la | head -10 -if [ -d "cmd/gateway" ]; then - echo "DEBUG: cmd/gateway directory exists" -else - echo "DEBUG: cmd/gateway directory does NOT exist" - echo "DEBUG: Looking for cmd directory:" - find . -name "cmd" -type d 2>/dev/null | head -5 -fi # Install dependencies echo "📦 Installing system dependencies..."