From ef32cb1c2ed740bba5cdbc1f9105233e99b3c106 Mon Sep 17 00:00:00 2001 From: sev Date: Fri, 5 Apr 2024 14:43:38 -0500 Subject: [PATCH 1/1] zshenv: add go env vars --- etc/zsh/.zshenv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.47.0