diff --git a/home/.scripts/update_go_apps.sh b/home/.scripts/update_go_apps.sh new file mode 100755 index 0000000..b6afafc --- /dev/null +++ b/home/.scripts/update_go_apps.sh @@ -0,0 +1,20 @@ +# 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=($@) + + if [ -z "${APPS}" ]; then + if [ -z "${GOAPPS}" ]; then + return + fi + + APPS=(${GOAPPS[@]}) + fi + + for APP in "${APPS[@]}"; do + echo "Updating ${APP}" + go get -u "${APP}" + done +}