From 0fb59f485916eb6559f93d1a19c436dd02062771 Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 9 Nov 2022 23:46:47 -0300 Subject: [PATCH] ammended compile.sh and .gitignore --- .gitignore | 1 + compile.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 609859b..b74312c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ test.c +test diff --git a/compile.sh b/compile.sh index f45619d..2ac5177 100755 --- a/compile.sh +++ b/compile.sh @@ -1,4 +1,5 @@ #!/bin/bash -[ "${1}" == "clean" ] && rm $(ls --color=no -1 | grep -v "\(\.c\|\.sh\)$") && exit +[ -z "${1}" ] && echo "error: no arguments given" && exit 2 +[ "${1}" == "clean" ] && rm -v $(ls --color=no -1 | grep -v "\(\.c\|\.sh\)$") && exit gcc -Wall -Wextra -O2 -g -o "${1:0:-2}" "${1}" exit