From 4993e35acfa8f30052353f39a91dfcbe6ba6e2a5 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Fri, 27 Aug 2021 10:53:50 -0700 Subject: [PATCH] Skip non-zip files when refreshing build library Test: th Change-Id: I16631183c40136c4603f20e2ea07664123338da4 --- tools/otagui/target_lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/otagui/target_lib.py b/tools/otagui/target_lib.py index db9ab9eea..bfc68d59e 100644 --- a/tools/otagui/target_lib.py +++ b/tools/otagui/target_lib.py @@ -130,8 +130,9 @@ class TargetLib: if os.path.isdir(path): builds_name = os.listdir(path) for build_name in builds_name: - self.new_build(build_name, os.path.join(path, build_name)) - elif os.path.isfile(path): + if build_name.endswith(".zip"): + self.new_build(build_name, os.path.join(path, build_name)) + elif os.path.isfile(path) and path.endswith(".zip"): self.new_build(os.path.split(path)[-1], path) return self.get_builds()