From c560228b3b5a9da01508ecfc6d9baeddb8f5e7ca Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Thu, 18 Jan 2018 10:50:03 -0500 Subject: [PATCH] Create easy way to update go binaries --- home/.scripts/update_go_apps.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 home/.scripts/update_go_apps.sh 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 +}