From 78deaebf737cdd5ced30d57e44a59bb76b51eefe Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 18 Nov 2017 14:19:08 +0100 Subject: [PATCH] Warn if latest version of Go is newer than installed Signed-off-by: Knut Ahlers --- .zsh/config.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.zsh/config.sh b/.zsh/config.sh index 8352e6c..807bf0d 100644 --- a/.zsh/config.sh +++ b/.zsh/config.sh @@ -2,7 +2,13 @@ export PATH=/usr/local/sbin:/usr/local/bin:$PATH ## Activate go using gimme if any go version is available -[ -e ${HOME}/.gimme/envs/latest.env ] && source ${HOME}/.gimme/envs/latest.env +GO_VER=$(curl -sSLf -m 2 'https://latest.luzifer.io/catalog-api/golang/latest.txt?p=version') +if [ -e "${HOME}/.gimme/envs/go${GO_VER}.env" ]; then + source "${HOME}/.gimme/envs/go${GO_VER}.env" +else + echo "Your Go version is outdated (latest would be ${GO_VER})" + source "${HOME}/.gimme/envs/latest.env" +fi ## Custom scripts export PATH=$HOME/bin:$PATH