From 399bd179da7ea663f18f9ae6af36d404e3f0ac53 Mon Sep 17 00:00:00 2001 From: shaunrd0 Date: Sun, 28 Jul 2019 05:16:23 +0000 Subject: [PATCH] Update control flow in cmake-build.sh --- scripts/cmake-build.sh | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/scripts/cmake-build.sh b/scripts/cmake-build.sh index 471d829..0348c56 100755 --- a/scripts/cmake-build.sh +++ b/scripts/cmake-build.sh @@ -11,36 +11,17 @@ do printf "\nEnter 1 to build, 2 to cleanup previous build, 0 to exit.\n" read bChoice - # Build loop - # If input read is == 1 - if [ $bChoice -eq 1 ] + if [ $bChoice -eq 1 ] # Build project then mkdir build (cd build && cmake .. && cmake --build .) - fi - - # Clean-up loop - # If input read is == 2 - if [ $bChoice -eq 2 ] - then + elif [ $bChoice -eq 2 ] ; then # Cleanup build rm -Rv build/* - fi - - # Exit loops, all other input - - - # If input read is >= 3, exit - if [ $bChoice -ge 3 ] - then - break + elif [ $bChoice -eq 0 ] ; then # Exit script + break + else + continue fi - # If input read is <= 0, exit - if [ $bChoice -le 0 ] - then - break - fi - - # Bash will print an error if symbol or character input - done