mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
only show magic command fields if magic as used
This commit is contained in:
@ -458,16 +458,15 @@ def add_metadata_to(list_or_dict,
|
||||
"""
|
||||
run_timestamp = runtime.timestamp()
|
||||
|
||||
if not run_command:
|
||||
magic_exit_code = None
|
||||
|
||||
meta_obj = {
|
||||
'parser': parser_name,
|
||||
'magic_command': run_command,
|
||||
'magic_command_exit': magic_exit_code,
|
||||
'timestamp': run_timestamp
|
||||
}
|
||||
|
||||
if run_command:
|
||||
meta_obj['magic_command'] = run_command
|
||||
meta_obj['magic_command_exit'] = magic_exit_code
|
||||
|
||||
if isinstance(list_or_dict, dict):
|
||||
if '_jc_meta' not in list_or_dict:
|
||||
list_or_dict['_jc_meta'] = {}
|
||||
|
Reference in New Issue
Block a user