Really minimal template, that works well for all scenarios and doesn't cause unexpected behaviour (like changing IFS does):
#!/usr/bin/env bash
set -eEu -o pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
reference all relative things with dir first: "$DIR/relativestuff.sh"