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 if [ -f "${HOME}/.zshrc.d/init" ]; then
exec sway source "${HOME}/.zshrc.d/init"
exit $?
fi fi
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" 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}" export PATH="${HOME}/bin:${PATH}"
fi 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 { # oh-my-zsh {
export ZSH="${HOME}/.oh-my-zsh" export ZSH="${HOME}/.oh-my-zsh"
@ -17,6 +24,7 @@ export UPDATE_ZSH_DAYS=7
DISABLE_UPDATE_PROMPT="true" DISABLE_UPDATE_PROMPT="true"
HIST_STAMPS="mm/dd/yyyy" HIST_STAMPS="mm/dd/yyyy"
plugins=( plugins=(
aws
autojump autojump
battery battery
brew brew
@ -91,64 +99,44 @@ if 2>&1 cp --help | grep -q reflink; then
else else
alias cp='cp -i' alias cp='cp -i'
fi 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" CARGO_ENV="${HOME}/.cargo/env"
if [ -f "${CARGO_ENV}" ]; then if [ -f "${CARGO_ENV}" ]; then
source "${CARGO_ENV}" source "${CARGO_ENV}"
fi fi
if [ -x "${REPOS}/termpdf/termpdf" ]; then
alias termpdf="${REPOS}/termpdf/termpdf"
fi
# add awless autocompletion if available # add awless autocompletion if available
if command -v awless &> /dev/null; then if command -v awless &> /dev/null; then
source <(awless completion zsh) source <(awless completion zsh)
fi 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 if command -v fzf &> /dev/null; then
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l' export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}" export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
fi 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 export GO111MODULE=on
case "$(uname)" in case "$(uname)" in
@ -162,6 +150,10 @@ case "$(uname)" in
if command -v gtar &> /dev/null; then if command -v gtar &> /dev/null; then
alias tar='gtar' alias tar='gtar'
fi fi
if command -v gsed &> /dev/null; then
alias sed='gsed'
fi
;; ;;
"Linux") "Linux")
alias open="xdg-open" alias open="xdg-open"
@ -169,7 +161,14 @@ case "$(uname)" in
esac 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 for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
if ! [ -x "${SCRIPT}" ]; then if ! [ -x "${SCRIPT}" ]; then
continue continue
@ -177,10 +176,3 @@ for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
source "${SCRIPT}" source "${SCRIPT}"
done 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 esac
if command -v update_go_apps &> /dev/null; then
update_go_apps || return $?
fi
if command -v vim &> /dev/null; then if command -v vim &> /dev/null; then
vim -c 'PlugUpgrade | q' || return $? vim -c 'PlugUpgrade | q' || return $?
vim -c 'PlugUpdate | sleep 3 | qa' || return $? vim -c 'PlugUpdate | sleep 3 | qa' || return $?