22 lines
987 B
Bash
Executable File
22 lines
987 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Local REA launcher. Setup paths live in ignored .tools/rea.env; no client edits.
|
|
set -euo pipefail
|
|
NEUTRON_REA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$NEUTRON_REA_ROOT"
|
|
if [[ -f .tools/rea.env ]]; then source .tools/rea.env; fi
|
|
export GHIDRA_INSTALL_DIR="${GHIDRA_INSTALL_DIR:-$NEUTRON_REA_ROOT/.tools/ghidra_12.1.4_PUBLIC}"
|
|
export JAVA_HOME="${NEUTRON_REA_JAVA_HOME:-$NEUTRON_REA_ROOT/.tools/java/usr/lib/jvm/java-21-openjdk-amd64}"
|
|
NEUTRON_REA_NODE="${NEUTRON_REA_NODE:-node}"
|
|
if [[ ! -x "$JAVA_HOME/bin/javac" || ! -x "$GHIDRA_INSTALL_DIR/support/analyzeHeadless" ]]; then
|
|
echo 'REA requires the local Ghidra/full JDK setup; see docs/rea.md.' >&2
|
|
exit 2
|
|
fi
|
|
if [[ -n "${NEUTRON_REA_LAUNCHER:-}" ]]; then
|
|
exec "$NEUTRON_REA_NODE" "$NEUTRON_REA_LAUNCHER" "$@"
|
|
elif command -v rea >/dev/null; then
|
|
exec rea "$@"
|
|
else
|
|
echo 'Set NEUTRON_REA_LAUNCHER to the installed public scripts/rea.mjs; see docs/rea.md.' >&2
|
|
exit 2
|
|
fi
|