From 652c5922640fcedb1cc0f869d960456d8dac10ec Mon Sep 17 00:00:00 2001 From: Andy Jones Date: Fri, 19 Apr 2024 13:15:44 +0100 Subject: [PATCH] Handle no go version set case (#132) --- set-env.fish | 2 +- set-env.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/set-env.fish b/set-env.fish index a9b0db9..d594458 100644 --- a/set-env.fish +++ b/set-env.fish @@ -1,5 +1,5 @@ function asdf_update_golang_env --on-event fish_prompt - set --local go_path (asdf which go) + set --local go_path (asdf which go 2>/dev/null) if test -n "$go_path" set --local full_path (builtin realpath "$go_path") diff --git a/set-env.zsh b/set-env.zsh index 248e164..c15e683 100644 --- a/set-env.zsh +++ b/set-env.zsh @@ -1,6 +1,6 @@ asdf_update_golang_env() { local go_path - go_path="$(asdf which go)" + go_path="$(asdf which go 2>/dev/null)" if [[ -n "${go_path}" ]]; then export GOROOT GOROOT="$(dirname "$(dirname "${go_path:A}")")"