From: sev Date: Fri, 5 Apr 2024 19:43:38 +0000 (-0500) Subject: zshenv: add go env vars X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/ef32cb1c2ed740bba5cdbc1f9105233e99b3c106?ds=sidebyside;hp=e7e78648a11c6a494c27bd4c68fbbb37d0e0ed9d zshenv: add go env vars --- diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index c63c390..1248dbf 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -211,7 +211,7 @@ if [[ ! -v _sev_setup_xdg ]] { # include any of the below dirs there, but you never know what crazy shit # people will do. I rather handle them sanely with our own code than let # them override after the fact. - [[ -e $XDG_CONFIG_HOME/user-dirs.dirs ]] && + [[ -f $XDG_CONFIG_HOME/user-dirs.dirs ]] && emulate sh -c "source $XDG_CONFIG_HOME/user-dirs.dirs" typeset -UT XDG_DATA_DIRS xdg_data_dirs @@ -292,6 +292,12 @@ if [[ ! -v GNUPGHOME ]] { eval $(perl -I$XDG_DATA_HOME/perl5/lib/perl5 \ -Mlocal::lib=$XDG_DATA_HOME/perl5 2>/dev/null) +## go +if [[ -v commands[go] ]] { + [[ ! -v GOPATH ]] && export GOPATH=${XDG_DATA_HOME:-~/.local/share}/go:~/go + [[ ! -v GOBIN ]] && export GOBIN=~/.local/bin +} + ### load zshenv site-specific autoload -Uz load-site-dotfile load-site-dotfile zshenv