#!/bin/bash

# Shared helper for loading local-only SLURM overrides.
# By default, scripts load slurm/.env.local if present.

load_slurm_local_env() {
    local script_dir env_file
    script_dir="$1"
    env_file="${LLMDEBUG_SLURM_ENV_FILE:-${script_dir}/.env.local}"

    if [[ ! -f "$env_file" ]]; then
        return 0
    fi

    set -a
    # shellcheck disable=SC1090
    source "$env_file"
    set +a
}
