about summary refs log tree commit diff
path: root/.custom-format.py
diff options
context:
space:
mode:
Diffstat (limited to '.custom-format.py')
-rwxr-xr-x.custom-format.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/.custom-format.py b/.custom-format.py
index 7ac63396..8c7ea404 100755
--- a/.custom-format.py
+++ b/.custom-format.py
@@ -19,6 +19,7 @@ import subprocess
 import sys
 import os
 import re
+import shutil
 
 # string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # future use
 
@@ -26,6 +27,10 @@ with open(".clang-format") as f:
     fmt = f.read()
 
 CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN")
+
+if CLANG_FORMAT_BIN is None:
+    CLANG_FORMAT_BIN = shutil.which("clang-format")
+
 if CLANG_FORMAT_BIN is None:
     o = 0
     try: