#!/bin/sh

export PATH="$PATH:$HOME/.cargo/bin"
CARGO=$(which cargo)
RUSTC=$(which rustc)
if [ -n "$CARGO" ] && [ -n "$RUSTC" ]; then
  echo "Building from source using $(cargo --version)"
  echo "Building from source using $(rustc --version)"
else
  echo "------------------ RUST COMPILER NOT FOUND --------------------"
  echo ""
  echo "Cargo or rust was not found. Please install cargo/rustc:"
  echo ""
  echo " - yum install cargo         (Fedora/CentOS)"
  echo " - apt-get install cargo     (Debian/Ubuntu)"
  echo " - brew install rust         (MacOS)"
  echo ""
  echo "Alternatively install Rust from: <https://rustup.rs/>"
  echo ""
  echo "---------------------------------------------------------------"
  exit 1
fi
