From 38e340ac8dbd815b9fa70faf5b81da4b135d8bfd Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 25 Mar 2025 00:32:00 +0200 Subject: [PATCH] chore(fix): goenvrc, fish alternative --- config/fish/exports.fish | 2 +- config/goenv/goenvrc | 9 ++++++--- config/goenv/goenvrc.fish | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 config/goenv/goenvrc.fish diff --git a/config/fish/exports.fish b/config/fish/exports.fish index 3539e53..a0bad45 100644 --- a/config/fish/exports.fish +++ b/config/fish/exports.fish @@ -112,7 +112,7 @@ set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME" fish_add_path "$GOBIN" set -q GOENV_ROOT; or set -x GOENV_ROOT "$XDG_DATA_HOME/goenv" -set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc" +set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc.fish" # 1Password configuration set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password" diff --git a/config/goenv/goenvrc b/config/goenv/goenvrc index c5d67c1..70af602 100644 --- a/config/goenv/goenvrc +++ b/config/goenv/goenvrc @@ -1,3 +1,6 @@ -GOENV_PATH_ORDER=front -GOENV_PREPEND_GOPATH=true -GOENV_AUTO_INSTALL=true +# Detect shell +if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then + export GOENV_PATH_ORDER=front + export GOENV_PREPEND_GOPATH=true + export GOENV_AUTO_INSTALL=true +fi diff --git a/config/goenv/goenvrc.fish b/config/goenv/goenvrc.fish new file mode 100644 index 0000000..99e035f --- /dev/null +++ b/config/goenv/goenvrc.fish @@ -0,0 +1,4 @@ +set -gx GOENV_PATH_ORDER front +set -gx GOENV_PREPEND_GOPATH true +set -gx GOENV_AUTO_INSTALL true +