# shellcheck shell=bash

build_rust_tui() {
  local build_type="${1:-release}"

  build_info "Building gw-tui (${build_type})..."

  ( cd "$SCRIPT_DIR/gw-tui" && {
      if [[ "$build_type" == "release" ]]; then
        cargo build --release
        build_success "Built gw-tui in release mode: ./gw-tui/target/release/gw-tui"
      else
        cargo build
        build_success "Built gw-tui in debug mode: ./gw-tui/target/debug/gw-tui"
      fi
    }
  )
}
