diff options
author | Gabor Kelemen <kelemen.gabor2@nisz.hu> | 2019-07-26 22:18:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-07-29 09:10:00 +0200 |
commit | fc6b31910f419ea7ea541aa9c4e44ba33d2cc549 (patch) | |
tree | 19b7d526a6a6420a5e4cb6e716735fa34b02a288 /bin | |
parent | loplugin:sequentialassign (diff) | |
download | core-fc6b31910f419ea7ea541aa9c4e44ba33d2cc549.tar.gz core-fc6b31910f419ea7ea541aa9c4e44ba33d2cc549.zip |
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-x | bin/find-unneeded-includes | 8 |
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) |