bin/find-unneeded-includes |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit fc6b31910f419ea7ea541aa9c4e44ba33d2cc549
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Fri Jul 26 22:18:10 2019 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Jul 29 09:10:00 2019 +0200

    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 <[email protected]>

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)
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to