about summary refs log tree commit diff
path: root/vcs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xvcs11
1 files changed, 10 insertions, 1 deletions
diff --git a/vcs b/vcs
index c1deea8..80f831b 100755
--- a/vcs
+++ b/vcs
@@ -1,6 +1,7 @@
 #!/bin/sh
 set -eu
 [ -n "${DEBUG:-}" ] && set -x
+: "${FORCE:=}"
 
 case "${1:-status}" in
 
@@ -12,7 +13,15 @@ commit)
     shift
 
     # prevent auto-commit of non-web files
-    if git ls-files -md | grep -qvE -e .htm$ -e .html$ -e .md$; then
+    non_web=$(git ls-files -md | grep -vE \
+        -e .htm$ \
+        -e .html$ \
+        -e .md$ \
+        -e .jpg$ \
+        -e .css$)
+    if [ ! $? ] && [ -n "$FORCE" ]; then
+        echo not committing non-web files: >&2
+        echo "$non_web"
         exit 1
     fi