添加参数判断

main
Xiaohang 2025-03-24 14:36:19 +08:00
parent a31f5c7661
commit 82a3b6e7ef
1 changed files with 14 additions and 3 deletions

View File

@ -376,9 +376,20 @@ if len(sys.argv) > 7:
param_enable_upload_remote_config = sys.argv[7]
if __name__ == "__main__":
if project_id is None or platform is None or env is None or google_sheet_file_name is None or sheet_table_name is None:
config.notification.append_msg(f'参数错误[project_id:{project_id}, platform:{platform}, env:{env}, '
f'google_sheet_file_name:{google_sheet_file_name}, sheet_table_name:{sheet_table_name}]')
if project_id is None:
config.notification.append_msg(f'参数错误[project_id is None]')
exit(1)
if platform is None:
config.notification.append_msg(f'参数错误[platform is None]')
exit(1)
if env is None:
config.notification.append_msg(f'参数错误[env is None]')
exit(1)
if google_sheet_file_name is None or sheet_table_name is None:
config.notification.append_msg(f'参数错误[google_sheet_file_name or sheet_table_name is None]')
exit(1)
config_generator = ConfigGenerator(google_sheet_file_name, sheet_table_name, project_id, platform, env)