aboutsummaryrefslogtreecommitdiff
path: root/contrib/pre-commit/bash_syntax
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pre-commit/bash_syntax')
-rwxr-xr-xcontrib/pre-commit/bash_syntax5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/pre-commit/bash_syntax b/contrib/pre-commit/bash_syntax
index 5fecbfe..c2724b4 100755
--- a/contrib/pre-commit/bash_syntax
+++ b/contrib/pre-commit/bash_syntax
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2010, Benjamin C. Meyer <ben@meyerhome.net>
+# Copyright (c) 2010-2014, Benjamin C. Meyer <ben@meyerhome.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,9 @@
function test_file {
file="${1}"
+ if [ ! -f "${file}" ] ; then
+ return
+ fi
head -n 1 "${file}" | grep 'bash' | grep '^#!/' > /dev/null
if [ "$?" -eq 0 ] ; then
set -e