Move go version check to external file, add config check
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
56aea038c4
commit
0db8718c3d
2 changed files with 16 additions and 8 deletions
13
.zsh/check_go_version
Normal file
13
.zsh/check_go_version
Normal 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
|
||||||
|
|
|
@ -2,13 +2,7 @@
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
||||||
|
|
||||||
## Activate go using gimme if any go version is available
|
## 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')
|
source ${HOME}/.zsh/check_go_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
|
## Custom scripts
|
||||||
export PATH=$HOME/bin:$PATH
|
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
|
## Initialize GPG agent
|
||||||
source ${HOME}/.zsh/gpg-agent.plugin.zsh
|
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
|
source ${HOME}/.zsh/config-git.zsh
|
||||||
|
${HOME}/bin/check_config
|
||||||
|
|
||||||
## Load local-config if available
|
## Load local-config if available
|
||||||
[ -e ${HOME}/.zsh/local-config.zsh ] && source ${HOME}/.zsh/local-config.zsh
|
[ -e ${HOME}/.zsh/local-config.zsh ] && source ${HOME}/.zsh/local-config.zsh
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue