Y
Hacker News
new
|
ask
|
show
|
jobs
by
iokanuon
772 days ago
You could do that, and it'd still be POSIX-shell comptible:
loadenv() { case "$-" in *a*) source ./.env ;; *) set -a; source ./.env; set +a ;; esac }
Although I have yet to see a long shellscript utilise `set -a` globally :)