Optionally Update gadget config rather than repolace

This commit is contained in:
Ben Jackson 2020-05-15 15:14:36 +01:00 committed by Ben Jackson
commit 36253e58ce

View file

@ -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