From 36253e58ce500911145c1ab64fcb464ed78dc571 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 15 May 2020 15:14:36 +0100 Subject: [PATCH] Optionally Update gadget config rather than repolace --- install_gadget.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install_gadget.py b/install_gadget.py index 025a977..ced4d06 100755 --- a/install_gadget.py +++ b/install_gadget.py @@ -576,6 +576,11 @@ parser.add_argument( '--no-gadget-config', action = 'store_true', help = "Don't write the .gagets.json, just install" ) +parser.add_argument( '--update-gadget-config', + action = 'store_true', + help = + "Update the gadget config rather than overwrite it" ) + parser.add_argument( '--enable-custom', dest='custom_gadget_file', action='append', @@ -657,7 +662,12 @@ for custom_file_name in functools.reduce( operator.add, failed = [] -all_adapters = {} +if args.update_gadget_config: + with open( install.GetGadgetConfigFile( vimspector_base ), 'r' ) as f: + all_adapters = json.load( f ).get( 'adapters', {} ) +else: + all_adapters = {} + for name, gadget in GADGETS.items(): if not gadget.get( 'enabled', True ): if ( not args.force_all