summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-08-02 11:57:47 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-08-02 11:57:55 +0100
commit47ae7ea1bb7af5ee3a1b391ff7bc0fe907b1094d (patch)
treef46f03c34ccf975842584b259fce61d2e9591995 /check
parent81a5a94da7091489a65781763995e8969591d8c3 (diff)
downloadmorph-47ae7ea1bb7af5ee3a1b391ff7bc0fe907b1094d.tar.gz
Add check for #! in *.py files
We don't want to have any *.py files as executable scripts, so hashbangs never make sense.
Diffstat (limited to 'check')
-rwxr-xr-xcheck10
1 files changed, 10 insertions, 0 deletions
diff --git a/check b/check
index 660c8cf4..b9ed2d56 100755
--- a/check
+++ b/check
@@ -58,6 +58,16 @@ then
fi
;;
esac
+
+ case "$x" in
+ *.py)
+ if head -1 "$x" | grep '^#!' > /dev/null
+ then
+ echo "ERROR: $x has a hashbang" 1>&2
+ errors=1
+ fi
+ ;;
+ esac
done
fi
exit $errors