Is there an easy way in zsh to add a directory to my PATH only if it's not already present? (or, more generally, any environment variable). I've tried:
... but if that's executed twice, it gets added twice.
And then, add the path with:
Without having to worry if it was there already.
To add it at the front, do:
You'll have to do something like:
This works only if