fix for google drive upload script

This commit is contained in:
Denys Zaitsev
2025-07-03 15:08:43 +03:00
parent 291398a318
commit f6f0b0b266
+7 -2
View File
@@ -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) {