From a1b63fb90eddf827e465205f1f853236032ba2e3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 20 Mar 2016 17:10:47 -0400 Subject: [PATCH] copy_buildsync.sh: convert code to use funcs This makes the code a bit easier to follow and break up. --- scripts/copy_buildsync.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh index 61051971..a9c18a0d 100755 --- a/scripts/copy_buildsync.sh +++ b/scripts/copy_buildsync.sh @@ -34,7 +34,21 @@ VERBOSEP= [ -n "$VERBOSE" ] && RSYNC_OPTS+=( -v ) [ -n "$VERBOSEP" ] && VERBOSEP="-v" -for ARCH in "${ARCHES[@]}"; do +usage() { + cat <&2 fi +} -done +main() { + if [[ $# -ne 0 ]]; then + usage + fi + + local arch + for arch in "${ARCHES[@]}"; do + process_arch "${arch}" + done +} +main "$@" # vim:ts=2 sw=2 noet ft=sh: