Adjusts the directory until a compilation database is found.
(path)
| 102 | |
| 103 | |
| 104 | def find_compilation_database(path): |
| 105 | """Adjusts the directory until a compilation database is found.""" |
| 106 | result = os.path.realpath('./') |
| 107 | while not os.path.isfile(os.path.join(result, path)): |
| 108 | parent = os.path.dirname(result) |
| 109 | if result == parent: |
| 110 | print('Error: could not find compilation database.') |
| 111 | sys.exit(1) |
| 112 | result = parent |
| 113 | return result |
| 114 | |
| 115 | |
| 116 | def make_absolute(f, directory): |