From f6f0b0b2666fbb13783b65e2f49de937a866ba81 Mon Sep 17 00:00:00 2001 From: Denys Zaitsev Date: Thu, 3 Jul 2025 15:08:43 +0300 Subject: [PATCH] fix for google drive upload script --- build/gdrive_upload_full.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/gdrive_upload_full.ps1 b/build/gdrive_upload_full.ps1 index 75dc4ed..11fcd54 100644 --- a/build/gdrive_upload_full.ps1 +++ b/build/gdrive_upload_full.ps1 @@ -53,8 +53,13 @@ if ($fullZip) { Write-Output "[ACTION] Deleting old production builds, keeping only the newly uploaded file..." $uploadedFileName = $fullZip.Name - # Get list of files in the target folder - $existingFiles = (rclone ls "$prodUploadFolder" --files-only) | ForEach-Object { $_.Trim() } + # Get list of files in the target folder using rclone lsf and filter out directories + # rclone lsf lists files and directories, with directories having a '/' suffix + $existingFiles = (rclone lsf "$prodUploadFolder") | ForEach-Object { + $_.Trim() + } | Where-Object { + -not $_.EndsWith('/') + } if ($LASTEXITCODE -eq 0) { foreach ($fileName in $existingFiles) {