From f6330c7eec1189bbef07fc99d6f7ed92674dc260 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Thu, 29 Feb 2024 22:35:06 -0800 Subject: [PATCH] added in a 6th option in the menu for the tdd.sh. The new function is for adding modules to the project. --- tdd.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tdd.sh b/tdd.sh index fcb4a0c..4772162 100755 --- a/tdd.sh +++ b/tdd.sh @@ -12,6 +12,18 @@ clear_cmake_cache () { rm -rf CMakeCache.txt CMakeFiles/ } +add_new_module () { + read -p "Enter the name of the module:" modname + modsrc_dir="./src/${modname}" + modtest_dir="./tests/${modname}" + + echo "creating: ${modsrc_dir}, ${modtest_dir}" + mkdir $modsrc_dir + mkdir $modtest_dir + + #copy the template files. +} + cross_compile () { echo "ERROR: Currently no toolchain / target!" } @@ -42,11 +54,12 @@ print_menu () { echo "2. Build Project" echo "3. Build for release" echo "4. cross compile for XXXXXX" - echo "5. Exit" + echo "5. Add new module to project" + echo "6. Exit" } -menu () { +main() { valid_choice=false while [ "$valid_choice" != true ]; do @@ -75,6 +88,11 @@ menu () { cross_compile ;; 5) + echo "You selected Option 5" + valid_choice=true + add_new_module + ;; + 6) echo "Exiting..." exit 0 ;;