-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·48 lines (39 loc) · 1.26 KB
/
install.sh
File metadata and controls
executable file
·48 lines (39 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
# RustRay Installation Script
# This script builds and installs the RustRay binary.
echo "Starting RustRay installation..."
# Check for Rust toolchain
if ! command -v cargo &> /dev/null; then
echo "Error: Rust toolchain (cargo) is not installed."
echo "Please install Rust from https://rustup.rs/"
exit 1
fi
# Build the project in release mode
echo "Building RustRay in release mode..."
cargo build --release
# Define installation paths
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="rustray"
SOURCE_BINARY="target/release/$BINARY_NAME"
# Check if build was successful
if [ ! -f "$SOURCE_BINARY" ]; then
echo "Error: Build failed. Binary not found at $SOURCE_BINARY"
exit 1
fi
# Install the binary
echo "Installing $BINARY_NAME to $INSTALL_DIR..."
if [ -w "$INSTALL_DIR" ]; then
cp "$SOURCE_BINARY" "$INSTALL_DIR/"
else
echo "Requesting sudo permissions to copy binary to $INSTALL_DIR"
sudo cp "$SOURCE_BINARY" "$INSTALL_DIR/"
fi
# Verify installation
if command -v $BINARY_NAME &> /dev/null; then
echo "RustRay successfully installed!"
echo "Version: $($BINARY_NAME --version 2>/dev/null || echo 'Unknown')"
else
echo "Warning: Installation completed, but $BINARY_NAME is not in your PATH."
fi
echo "Installation complete."