From a3f53cac1afef4826902c1435c6c27cf56c632d6 Mon Sep 17 00:00:00 2001 From: Pysio Date: Thu, 7 Nov 2024 03:27:06 +0800 Subject: [PATCH] fix: output_dir: command not found --- .github/workflows/convert_images.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/convert_images.yml b/.github/workflows/convert_images.yml index d0b21ce..96628c5 100644 --- a/.github/workflows/convert_images.yml +++ b/.github/workflows/convert_images.yml @@ -55,14 +55,17 @@ jobs: - name: Generate url.csv run: | - output_dir = 'output' - base_url = 'https://randomimg.pysio.online/output/' - with open('url.csv', 'w') as f: - for filename in os.listdir(output_dir): - if filename == 'NULL': - continue - if filename.lower().endswith('webp'): - f.write(f'{base_url}{filename}\n') + base_url='https://randomimg.pysio.online/output/' + output_dir='output' + > url.csv + for filename in $(ls $output_dir); do + if [ "$filename" == "NULL" ]; then + continue + fi + if [[ $filename == *.webp ]]; then + echo "${base_url}${filename}" >> url.csv + fi + done - name: Commit and push changes env: