From 08947291932d6db5455161bace81085fe5a2b12c Mon Sep 17 00:00:00 2001 From: Roberto Oliveira Date: Fri, 9 Feb 2024 12:36:13 +0100 Subject: [PATCH] productized/remove_modules.sh: fail script if module is not found in the pom --- productized/remove_modules.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/productized/remove_modules.sh b/productized/remove_modules.sh index 3fa7a02b44..158fcd241c 100755 --- a/productized/remove_modules.sh +++ b/productized/remove_modules.sh @@ -22,7 +22,11 @@ do modules_list=$(echo $modules | tr "," "\n") for module in ${modules_list} do + if ! grep -Rq "${module}" ${pom} ; then + echo "Could not find module ${module} in ${pom}. Exiting script..." + exit 1 + fi echo "Removing module ${module} from ${pom}" - sed -i "/${module}<\/module/d" ${pom} + sed -i "/${module}<\/module>/d" ${pom} done done \ No newline at end of file