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