run_dev.sh 688 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # This script launches Open OSCAR Server using go run with the environment vars
  3. # defined in config/settings.env under MacOS/Linux. The script can be run from
  4. # any working directory--it assumes the location of config/command files
  5. # relative to the path of this script.
  6. set -e
  7. SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
  8. DEFAULT_ENV_FILE="$SCRIPT_DIR/../config/ssl/settings.env"
  9. if [ "$#" -gt 1 ]; then
  10. echo "Usage: $0 [path/to/settings.env]"
  11. exit 1
  12. fi
  13. if [ "$#" -eq 1 ]; then
  14. ENV_FILE="$1"
  15. else
  16. ENV_FILE="$DEFAULT_ENV_FILE"
  17. fi
  18. REPO_ROOT="$SCRIPT_DIR/.."
  19. # Run Open OSCAR Server from repo root.
  20. cd "$REPO_ROOT"
  21. go run -v ./cmd/server -config "$ENV_FILE"