From 2f5c57433612ec9fd3d214b6232ce6d93589a6af Mon Sep 17 00:00:00 2001 From: Feng Zhou <55177366+fengzhou-msft@users.noreply.github.com> Date: Fri, 16 Oct 2020 18:22:30 +0800 Subject: [PATCH] do not include hidden deprecated command (#2538) --- scripts/ci/update_ext_cmd_tree.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/ci/update_ext_cmd_tree.py b/scripts/ci/update_ext_cmd_tree.py index 0e27fd76dcf..513119544dc 100644 --- a/scripts/ci/update_ext_cmd_tree.py +++ b/scripts/ci/update_ext_cmd_tree.py @@ -49,7 +49,14 @@ def update_cmd_tree(ext_name): EXT_CMD_TREE_TO_UPLOAD = Session() EXT_CMD_TREE_TO_UPLOAD.load(os.path.expanduser(os.path.join('~', '.azure', file_name))) root = {} - for cmd_name, _ in extension_command_table.items(): + for cmd_name, ext_cmd in extension_command_table.items(): + try: + # do not include hidden deprecated command + if ext_cmd.deprecate_info.hide: + print(f"Skip hidden deprecated command: {cmd_name}") + continue + except AttributeError: + pass parts = cmd_name.split() parent = root for i, part in enumerate(parts): @@ -88,4 +95,5 @@ def upload_cmd_tree(): if __name__ == '__main__': for ext in sys.argv[1:]: update_cmd_tree(ext) + print() upload_cmd_tree()