From f5f085f35ec5f379dc51ba813186a0b975e5df41 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 24 Apr 2024 04:44:33 +0800 Subject: [PATCH] test: create bins dir on demand --- .github/workflows/build-gsa.yml | 1 + scripts/download.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-gsa.yml b/.github/workflows/build-gsa.yml index 3a1c438168..b43ff45e44 100644 --- a/.github/workflows/build-gsa.yml +++ b/.github/workflows/build-gsa.yml @@ -2,6 +2,7 @@ name: Goreleaser on: push: + branches: [ master ] tags: - "*" diff --git a/scripts/download.py b/scripts/download.py index 2ce30d31c6..2cd78795be 100644 --- a/scripts/download.py +++ b/scripts/download.py @@ -43,7 +43,11 @@ def download(filename: str): response = requests.get(file_info['browser_download_url']) response.raise_for_status() - with open(get_bin_path(filename), 'wb') as f: + bin_path = get_bin_path(filename) + + os.makedirs(os.path.dirname(bin_path), exist_ok=True) + + with open(bin_path, 'wb') as f: f.write(response.content) print(f"Downloaded {filename}")