do 615 B

12345678910111213141516171819
  1. #!/bin/sh
  2. export PATH=$HOME/.cargo/bin:$PATH
  3. CARGO=$(command -v cargo)
  4. set -e
  5. if test "x$CARGO" = "x"; then
  6. printf "Rust & Cargo are required in order to build cjdns\n"
  7. printf "See https://rustup.rs/ for install instructions\n"
  8. exit 1
  9. fi
  10. release="--release"
  11. path="release"
  12. if echo "$@" | grep -q '\-\-debug'; then
  13. release=""
  14. path="debug"
  15. fi
  16. RUSTFLAGS="$RUSTFLAGS -g" $CARGO build $release
  17. RUST_BACKTRACE=1 ./target/$path/testcjdroute all >/dev/null
  18. mv ./target/$path/cjdroute ./target/$path/cjdnstool ./
  19. printf "\x1b[1;32mBuild completed successfully, type ./cjdroute to begin setup.\x1b[0m\n"