Handle filenames / dirnames with spaces
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 2 Sep 2015 07:13:02 +0000 (09:13 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 2 Sep 2015 07:13:02 +0000 (09:13 +0200)
check.sh

index f1a9323..4bd7204 100755 (executable)
--- a/check.sh
+++ b/check.sh
@@ -13,17 +13,17 @@ fi
 
 # look for test in guest tests
 test_file=
-if [ -f $1 ]; then
-    test_file=$1
+if [ -f "$1" ]; then
+    test_file="$1"
 fi
 
 # look for test in guest tests
-if [ -f $1.py ]; then
-    test_file=$1.py
+if [ -f "$1.py" ]; then
+    test_file="$1.py"
 fi
 
 # error if not found yet
-if [ $test_file = "" ]; then
+if [ "$test_file" = "" ]; then
     echo "Could not find $1!"
     exit 2
 fi
@@ -36,14 +36,14 @@ echo
 
 # run pep8
 echo "pep8:"
-pep8 $test_file
+pep8 "$test_file"
 pep8_return=$?
 echo
 
 # done
 echo Done checking
 if [[ $pylint_return == 0 && $pep8_return == 0 ]]; then
-    echo Everything seems to be fine
+    echo "Everything seems to be fine"
 else
-    echo Please correct
+    echo "Please correct"
 fi