Skip to content

Commit

Permalink
Don't show file list if there is no up-to-date packages
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jul 21, 2024
1 parent 2e65a72 commit 2dee388
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions package_build/file_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
def show_file_list(root_dir: Path) -> None:
st.subheader("Package files awailable to download")

if not list(root_dir.glob("*.zip")):
file_list = [file for file in root_dir.glob("*.zip") if package_up_to_date(file)]

if not file_list:
st.write("No package files available.")
return

column1, column2, column3 = st.columns([3, 2, 1], vertical_alignment="center")
column1.write("Package name")
column2.write("When created")

for package_path in sorted(root_dir.glob("*.zip")):
if not package_up_to_date(package_path):
continue

for package_path in sorted(file_list):
column1, column2, column3 = st.columns([3, 2, 1], vertical_alignment="center")
column1.write(package_path.relative_to(root_dir).name)
hours_ago = (datetime.now(tz=timezone.utc) - get_file_modification_datetime(package_path)).seconds // 3600
Expand Down

0 comments on commit 2dee388

Please sign in to comment.