Files

39 lines
836 B
Bash
Raw Permalink Normal View History

2026-06-16 20:25:19 +08:00
#!/usr/bin/env bash
set -euo pipefail
2026-07-15 10:07:17 +08:00
clear
echo "Cleaning target and dist directories..."
rm -rf target dist
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
echo "Building unixtract (Linux + Windows)..."
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
# Clean using cargo (redundant but safe)
cargo clean
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
# Build Linux
cargo build --target x86_64-unknown-linux-gnu --release
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
# Build Windows (GNU)
cargo build --target x86_64-pc-windows-gnu --release
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
# Prepare dist folder
mkdir -p dist
2026-07-15 09:50:27 +08:00
2026-07-15 10:07:17 +08:00
echo "Collecting binaries..."
2026-07-15 09:50:27 +08:00
2026-07-15 10:07:17 +08:00
# Linux binary
LINUX_BIN="target/x86_64-unknown-linux-gnu/release/unixtract"
if [ -f "$LINUX_BIN" ]; then
cp "$LINUX_BIN" "dist/unixtract-linux"
fi
2026-07-15 09:50:27 +08:00
2026-07-15 10:07:17 +08:00
# Windows binary
WINDOWS_BIN="target/x86_64-pc-windows-gnu/release/unixtract.exe"
if [ -f "$WINDOWS_BIN" ]; then
cp "$WINDOWS_BIN" "dist/unixtract-windows.exe"
fi
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
echo "Cleaning target directory..."
rm -rf target
2026-06-16 20:25:19 +08:00
2026-07-15 10:07:17 +08:00
echo "Done. Binaries are in ./dist"