Allow running dump_format_style.py from any directory.
authorAlexander Kornienko <alexfh@google.com>
Tue, 23 Feb 2016 16:11:43 +0000 (16:11 +0000)
committerAlexander Kornienko <alexfh@google.com>
Tue, 23 Feb 2016 16:11:43 +0000 (16:11 +0000)
llvm-svn: 261642

clang/docs/tools/dump_format_style.py

index b61d2017d05f4f187e1143a2338115f36ff5e875..42e957044fd2b0015658351f1b25e3b19d152ad8 100755 (executable)
@@ -4,11 +4,13 @@
 # Run from the directory in which this file is located to update the docs.
 
 import collections
+import os
 import re
 import urllib2
 
-FORMAT_STYLE_FILE = '../../include/clang/Format/Format.h'
-DOC_FILE = '../ClangFormatStyleOptions.rst'
+CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..')
+FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h')
+DOC_FILE = os.path.join(CLANG_DIR, 'docs/ClangFormatStyleOptions.rst')
 
 
 def substitute(text, tag, contents):