Homebrew has a tendency to add a duplicate entry to the PATH. This bit of line noise de-dupes the PATH variable. Keeps the first appearance, and handles paths with trailing slashes:

# De-dupe path
# @see https://github.com/Homebrew/brew/issues/14560
PATH=$(awk -v RS=: -v ORS=: '{sub(/\/+$/, "", $0); if (!seen[$0]++) print $0}' <<< "$PATH": | sed 's/:$//')