summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2019-07-26 22:18:10 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-07-29 09:10:00 +0200
commitfc6b31910f419ea7ea541aa9c4e44ba33d2cc549 (patch)
tree19b7d526a6a6420a5e4cb6e716735fa34b02a288 /bin
parent0d36b32755ac662299e6a8165e9fa57311b74a2f (diff)
find-unneeded-includes: warn first time user nicely about missing file
Change-Id: Ibc0b818a410cf0aee19b1d2a42a53db9aff87638 Reviewed-on: https://gerrit.libreoffice.org/76461 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'bin')
-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)