From ac10dd826139b13866bf5126f64d8b1b81452939 Mon Sep 17 00:00:00 2001 From: pedrofnseca Date: Tue, 29 Aug 2023 05:12:48 -0300 Subject: [PATCH] feat: add protection to run --- build.sh | 8 ++------ main_run.sh | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 62e714c..f51dc43 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,7 @@ #!/bin/bash +set -e + mkdir -p bin gcc -o bin/main src/main.c -lmicrohttpd - -if [ $? -eq 0 ]; then - echo "Compilação bem-sucedida." -else - echo "Erro durante a compilação." -fi diff --git a/main_run.sh b/main_run.sh index 01c0e74..ed2f314 100755 --- a/main_run.sh +++ b/main_run.sh @@ -1,7 +1,9 @@ #!/bin/bash +set -e + ./build.sh echo "Executando o programa..." -./bin/main \ No newline at end of file +./bin/main