From f8067a449ba318fc705930f1bac095ead324324d Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 15 Jun 2020 23:03:03 +0200 Subject: [PATCH] checkcode.sh: Abort if no path is provided This ensures we don't try to check all python files in '/' if the argument to the checkcode.sh script is missed by accident. Signed-off-by: Paul Barker Signed-off-by: Jan Kiszka --- scripts/checkcode.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/checkcode.sh b/scripts/checkcode.sh index 06f16b3..2b21894 100755 --- a/scripts/checkcode.sh +++ b/scripts/checkcode.sh @@ -2,6 +2,11 @@ ERROR=0 +if [ $# != 1 ]; then + echo "Error: Please provide a path as the argument to this script!" + exit 1 +fi + echo "Checking with pycodestyle" pycodestyle --ignore=W503,W606 $1/*.py $1/*/*.py || ERROR=$(expr $ERROR + 1)