remove Go app "updater", I do not use them anymore. Also cleanup .zshrc a little bit

This commit is contained in:
Tony Blyler 2020-12-31 12:04:07 -05:00
parent fa561a65d9
commit ff86d61df9
4 changed files with 44 additions and 92 deletions

View file

@ -1,6 +1,5 @@
if [ -f "${HOME}/.zshrc.d/sway_enabled" ] && command -v tty &> /dev/null && command -v sway &> /dev/null && [ "$(tty)" = '/dev/tty1' ]; then
exec sway
exit $?
if [ -f "${HOME}/.zshrc.d/init" ]; then
source "${HOME}/.zshrc.d/init"
fi
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
@ -8,6 +7,14 @@ if [ -d "${HOME}/bin" ]; then
export PATH="${HOME}/bin:${PATH}"
fi
if command -v go &> /dev/null; then
GOPATH="$(go env GOPATH)"
if [ -d "${GOPATH}" ]; then
export GOPATH
export PATH="${GOPATH}/bin:${PATH}"
fi
fi
# oh-my-zsh {
export ZSH="${HOME}/.oh-my-zsh"
@ -17,6 +24,7 @@ export UPDATE_ZSH_DAYS=7
DISABLE_UPDATE_PROMPT="true"
HIST_STAMPS="mm/dd/yyyy"
plugins=(
aws
autojump
battery
brew
@ -91,64 +99,44 @@ if 2>&1 cp --help | grep -q reflink; then
else
alias cp='cp -i'
fi
alias mv='mv -i'
alias dco='docker-compose'
alias mk='minikube'
alias k='kubectl'
alias kctx='kubectx'
alias kns='kubens'
REPOS="${HOME}/repos"
alias mv='mv -i'
if command -v docker-compose &> /dev/null; then
alias dco='docker-compose'
fi
if command -v minikube &> /dev/null; then
alias mk='minikube'
fi
if command -v kubectl &> /dev/null; then
alias k='kubectl'
fi
if command -v kubectx &> /dev/null; then
alias kctx='kubectx'
fi
if command -v kubens &> /dev/null; then
alias kns='kubens'
fi
CARGO_ENV="${HOME}/.cargo/env"
if [ -f "${CARGO_ENV}" ]; then
source "${CARGO_ENV}"
fi
if [ -x "${REPOS}/termpdf/termpdf" ]; then
alias termpdf="${REPOS}/termpdf/termpdf"
fi
# add awless autocompletion if available
if command -v awless &> /dev/null; then
source <(awless completion zsh)
fi
# add kubectl autocompletion if available
if command -v kubectl &> /dev/null; then
source <(kubectl completion zsh)
fi
# add helm autocompletion if available
if command -v helm &> /dev/null; then
source <(helm completion zsh)
fi
# add aws autocompletion if available
if command -v aws &> /dev/null; then
complete -C aws_completer aws
fi
if command -v fzf &> /dev/null; then
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
fi
NIX_SH="${HOME}/.nix-profile/etc/profile.d/nix.sh"
if [ -f "${NIX_SH}" ]; then
source "${NIX_SH}"
fi
export GOAPPS=(
'github.com/dgraph-io/badger/...'
'github.com/golang/protobuf/protoc-gen-go'
'github.com/google/huproxy/huproxyclient'
'github.com/jedisct1/piknik'
'github.com/junegunn/fzf'
'github.com/tomnomnom/gron'
'github.com/wallix/awless'
'google.golang.org/grpc'
)
export GO111MODULE=on
case "$(uname)" in
@ -162,6 +150,10 @@ case "$(uname)" in
if command -v gtar &> /dev/null; then
alias tar='gtar'
fi
if command -v gsed &> /dev/null; then
alias sed='gsed'
fi
;;
"Linux")
alias open="xdg-open"
@ -169,7 +161,14 @@ case "$(uname)" in
esac
# }
# load any file that ends with .zsh or .sh
source "${HOME}/.homesick/repos/homeshick/homeshick.sh"
homeshick refresh 5 -q
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# load any file that ends with .zsh or .sh and is executable
for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
if ! [ -x "${SCRIPT}" ]; then
continue
@ -177,10 +176,3 @@ for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
source "${SCRIPT}"
done
source "${HOME}/.homesick/repos/homeshick/homeshick.sh"
homeshick refresh 5 -q
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View file

@ -1,10 +0,0 @@
#!/bin/bash
if command -v go &> /dev/null; then
GOPATH="$(go env GOPATH)"
if [ -n "${GOPATH}" ]; then
export GOPATH
export PATH="${GOPATH}/bin:${PATH}"
fi
else
>&2 echo '"go" is missing from the PATH'
fi

View file

@ -1,26 +0,0 @@
#!/bin/bash
# updates go binary installs that you care about.
# if the GOAPPS environment variable is set, it is expected to be
# an array
update_go_apps() {
(
cd || exit $?
local APPS=("${@}")
if [ -z "${APPS[0]}" ]; then
if [ -z "${GOAPPS}" ]; then
exit 0
fi
APPS=("${GOAPPS[@]}")
fi
local APP
for APP in "${APPS[@]}"; do
echo "Updating ${APP}"
go get -u "${APP}" || exit $?
done
) || return $?
}

View file

@ -29,10 +29,6 @@ upgrade_system() {
;;
esac
if command -v update_go_apps &> /dev/null; then
update_go_apps || return $?
fi
if command -v vim &> /dev/null; then
vim -c 'PlugUpgrade | q' || return $?
vim -c 'PlugUpdate | sleep 3 | qa' || return $?