summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/find-unneeded-includes8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 66a5df6f044b..c89b69fc9d2a 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -296,8 +296,12 @@ def main(argv):
print("usage: find-unneeded-includes [FILE]...")
return
- with open("compile_commands.json", 'r') as compileCommandsSock:
- compileCommands = json.load(compileCommandsSock)
+ try:
+ with open("compile_commands.json", 'r') as compileCommandsSock:
+ compileCommands = json.load(compileCommandsSock)
+ except FileNotFoundError:
+ print ("File 'compile_commands.json' does not exist, please run:\nmake vim-ide-integration")
+ sys.exit(-1)
tidy(compileCommands, paths=argv)