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) {