#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
game_dir="${CYBERPUNK2077_GAME_DIR:-/var/home/salt/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Cyberpunk 2077}"
script_out="$game_dir/r6/scripts/EdgeWeightGPS"

mkdir -p "$script_out"
install -m 0644 "$repo_root/redscript/EdgeWeightGPS/EdgeWeightGPS.reds" "$script_out/EdgeWeightGPS.reds"

printf 'Installed %s\n' "$script_out/EdgeWeightGPS.reds"
