tb-dotfiles/home/.zshrc.d/01_update_go_apps.sh

23 lines
393 B
Bash
Raw Normal View History

#!/bin/bash
2018-01-18 10:50:03 -05:00
# 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() {
local APPS=("${@}")
2018-01-18 10:50:03 -05:00
if [ -z "${APPS[0]}" ]; then
2018-01-18 10:50:03 -05:00
if [ -z "${GOAPPS}" ]; then
return
fi
APPS=("${GOAPPS[@]}")
2018-01-18 10:50:03 -05:00
fi
local APP
2018-01-18 10:50:03 -05:00
for APP in "${APPS[@]}"; do
echo "Updating ${APP}"
go get -u "${APP}" || return $?
2018-01-18 10:50:03 -05:00
done
}