app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

run.sh (846B)


      1 #!/usr/bin/env bash
      2 set -euo pipefail
      3 
      4 script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
      5 repo_root="$(git -C "${script_dir}" rev-parse --show-toplevel)"
      6 
      7 cd "${repo_root}"
      8 
      9 runtime_mode="${RADROOTS_APP_RUNTIME_MODE:-localhost-dev}"
     10 nostr_relay_urls="${RADROOTS_APP_NOSTR_RELAY_URLS:-}"
     11 local_log_root="${RADROOTS_APP_LOCAL_LOG_ROOT:-${repo_root}/logs}"
     12 
     13 if [[ -z "${nostr_relay_urls}" ]]; then
     14   echo "missing required env: RADROOTS_APP_NOSTR_RELAY_URLS" >&2
     15   exit 1
     16 fi
     17 
     18 export RADROOTS_APP_RUNTIME_MODE="${runtime_mode}"
     19 export RADROOTS_APP_NOSTR_RELAY_URLS="${nostr_relay_urls}"
     20 export RADROOTS_APP_LOCAL_LOG_ROOT="${local_log_root}"
     21 export RUST_LOG="${RADROOTS_APP_RUST_LOG:-info}"
     22 
     23 if [[ "$(uname -s)" == "Darwin" ]]; then
     24   exec "${repo_root}/platforms/macos/Scripts/run_host.sh" "$@"
     25 fi
     26 
     27 exec cargo run -p radroots_app -- "$@"