26 lines
732 B
Bash
26 lines
732 B
Bash
#!/usr/bin/env bash
|
|
# Build a real Windows .exe from Linux using Docker + Wine.
|
|
# Requires: docker, run from Scribd/ project root (or repo sets working-directory).
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
IMAGE="scribd-cross-win-builder"
|
|
|
|
echo "=== Docker: build Windows image ==="
|
|
docker build -f build/docker/Dockerfile.cross-win -t "$IMAGE" .
|
|
|
|
echo "=== Docker: run Windows cross-build ==="
|
|
docker run --rm --platform linux/amd64 \
|
|
-v "$ROOT:/src" \
|
|
-w /src \
|
|
"$IMAGE"
|
|
|
|
if [[ ! -f "$ROOT/dist/Scribd-PDF-Downloader-Windows.zip" ]]; then
|
|
echo "ERROR: dist/Scribd-PDF-Downloader-Windows.zip was not created"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Done: $ROOT/dist/Scribd-PDF-Downloader-Windows.zip"
|