From fbcd681da7013938b6b4a417710179ee03fb740f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 13 Apr 2019 04:48:46 -0700 Subject: [PATCH] Added example script. --- samples/examples.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 samples/examples.sh diff --git a/samples/examples.sh b/samples/examples.sh new file mode 100644 index 0000000..99926d3 --- /dev/null +++ b/samples/examples.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Version 1.0 + +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +# set the examples directories +declare -a examples=( + "java" + "kotlin") + +dir=$(dirname "$(readlink -f "$0")") +cyan=$(tput setaf 6) +normal=$(tput sgr0) + +i=0 +for ex in "${examples[@]}"; do + if [ $i -ne 0 ] + then + read -p "Press [Enter] key to continue..." + clear + fi + cd "$dir/$ex" || exit 1 + echo "> Project: ${cyan}${ex}${normal}" + ./gradlew --console=plain --no-build-cache clean "$@" || exit 1 + (( i++ )) +done