mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-15 21:00:03 +02:00
39 lines
836 B
Bash
39 lines
836 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
clear
|
|
echo "Cleaning target and dist directories..."
|
|
rm -rf target dist
|
|
|
|
echo "Building unixtract (Linux + Windows)..."
|
|
|
|
# Clean using cargo (redundant but safe)
|
|
cargo clean
|
|
|
|
# Build Linux
|
|
cargo build --target x86_64-unknown-linux-gnu --release
|
|
|
|
# Build Windows (GNU)
|
|
cargo build --target x86_64-pc-windows-gnu --release
|
|
|
|
# Prepare dist folder
|
|
mkdir -p dist
|
|
|
|
echo "Collecting binaries..."
|
|
|
|
# Linux binary
|
|
LINUX_BIN="target/x86_64-unknown-linux-gnu/release/unixtract"
|
|
if [ -f "$LINUX_BIN" ]; then
|
|
cp "$LINUX_BIN" "dist/unixtract-linux"
|
|
fi
|
|
|
|
# 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
|
|
|
|
echo "Cleaning target directory..."
|
|
rm -rf target
|
|
|
|
echo "Done. Binaries are in ./dist" |