1
0
Fork 0

Move go version check to external file, add config check

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-02-11 01:09:47 +01:00
parent 56aea038c4
commit 0db8718c3d
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 16 additions and 8 deletions

13
.zsh/check_go_version Normal file
View file

@ -0,0 +1,13 @@
# If no network connection is available load latest available version
if ( ping -c 1 -q 8.8.8.8 >/dev/null ); then
GO_VER=$(curl -sSLf -m 2 'https://lv.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
else
source "${HOME}/.gimme/envs/latest.env"
fi

View file

@ -2,13 +2,7 @@
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
## Activate go using gimme if any go version is available
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
source ${HOME}/.zsh/check_go_version
## Custom scripts
export PATH=$HOME/bin:$PATH
@ -48,8 +42,9 @@ alias share='AWS_REGION=us-east-1 vault2env --key=secret/aws/private -- share --
## Initialize GPG agent
source ${HOME}/.zsh/gpg-agent.plugin.zsh
## Load config-git functions
## Load config-git functions and check for config updates
source ${HOME}/.zsh/config-git.zsh
${HOME}/bin/check_config
## Load local-config if available
[ -e ${HOME}/.zsh/local-config.zsh ] && source ${HOME}/.zsh/local-config.zsh