Update build/test scripts with clean progress indicators and minimal output
This commit is contained in:
@@ -1,37 +1,53 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
echo "========================================="
|
||||
# Spinner function
|
||||
spinner() {
|
||||
local pid=$1
|
||||
local delay=0.1
|
||||
local spinstr='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
|
||||
while ps -p $pid > /dev/null 2>&1; do
|
||||
local temp=${spinstr#?}
|
||||
printf " [%c] " "$spinstr"
|
||||
local spinstr=$temp${spinstr%"$temp"}
|
||||
sleep $delay
|
||||
printf "\b\b\b\b\b\b"
|
||||
done
|
||||
printf " \b\b\b\b"
|
||||
}
|
||||
|
||||
echo "Building Hero Supervisor Workspace"
|
||||
echo "========================================="
|
||||
|
||||
# Build core and client (workspace members)
|
||||
echo ""
|
||||
echo "📦 Building core and client..."
|
||||
|
||||
# Build core and client
|
||||
printf "📦 Core & Client... "
|
||||
cd "$PROJECT_DIR"
|
||||
RUSTFLAGS="-A warnings" cargo build --release --workspace
|
||||
if RUSTFLAGS="-A warnings" cargo build --release --workspace > /tmp/supervisor-build-core.log 2>&1 & spinner $!; wait $!; then
|
||||
echo "✅"
|
||||
else
|
||||
echo "❌"
|
||||
echo " Error: Build failed. Run 'cd $PROJECT_DIR && cargo build --release --workspace' for details"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ Core and client built successfully"
|
||||
|
||||
# Build UI (WASM target)
|
||||
echo ""
|
||||
echo "📦 Building UI (WASM)..."
|
||||
# Build UI
|
||||
printf "📦 UI (WASM)... "
|
||||
cd "$PROJECT_DIR/ui"
|
||||
|
||||
# Check if trunk is installed
|
||||
if ! command -v trunk &> /dev/null; then
|
||||
echo "⚠️ Warning: trunk not found. Skipping UI build."
|
||||
echo " Install trunk with: cargo install trunk"
|
||||
echo "⚠️ (trunk not installed)"
|
||||
echo " Install with: cargo install trunk"
|
||||
else
|
||||
trunk build --release
|
||||
echo "✅ UI built successfully"
|
||||
if trunk build --release > /tmp/supervisor-build-ui.log 2>&1 & spinner $!; wait $!; then
|
||||
echo "✅"
|
||||
else
|
||||
echo "❌"
|
||||
echo " Error: Build failed. Run 'cd $PROJECT_DIR/ui && trunk build --release' for details"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "========================================="
|
||||
echo "✅ All builds completed successfully"
|
||||
echo "========================================="
|
||||
echo "✅ All builds completed"
|
||||
Reference in New Issue
Block a user