40 lines
958 B
Bash
40 lines
958 B
Bash
#!/bin/bash
|
|
|
|
# Media Viewer Build Script
|
|
# This script automates the installation and building process
|
|
|
|
echo "Media Viewer Build Script"
|
|
echo "========================="
|
|
|
|
# Check if cargo is available
|
|
if ! command -v cargo &> /dev/null; then
|
|
echo "Error: Rust/Cargo not found. Please install Rust first."
|
|
echo "Visit https://www.rust-lang.org/tools/install for installation instructions."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Rust/Cargo detected. Proceeding with build..."
|
|
|
|
# Check if we're in the correct directory
|
|
if [ ! -f "Cargo.toml" ]; then
|
|
echo "Error: This script must be run from the project root directory."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building Media Viewer..."
|
|
|
|
# Build the application
|
|
cargo build
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "Build successful!"
|
|
echo "Executable location: target/debug/media-viewer.exe"
|
|
echo ""
|
|
echo "To run the application:"
|
|
echo " cargo run"
|
|
else
|
|
echo "Build failed!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Build process completed." |