Skip to content

Commit

Permalink
Fix processing empty directories
Browse files Browse the repository at this point in the history
  • Loading branch information
matejskubic authored Apr 24, 2020
1 parent b7cf332 commit a2f97e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sync-Pootle.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ function getRemoteFiles()
function sftpListDirectoryRecursive($remoteDir)
{
$result = [System.Collections.Generic.List[string]]::new()
if (!$sftp.Exists($remoteDir))
{
return
}
$files = $sftp.ListDirectory($remoteDir)
$files |% {
#$file = $files[2]
Expand Down Expand Up @@ -256,6 +260,10 @@ function transferTranslations([System.IO.FileInfo[]]$files, [ValidateSet("upload
$uploadFoldersToSync = New-Object "System.Collections.Generic.Dictionary[System.IO.DirectoryInfo, string]"

[System.IO.DirectoryInfo]$di = $exportXlifRootTo
if (!$files)
{
return
}
$files | % {
$fi = $_
$relPath = $fi.Directory.FullName.Remove(0, $di.FullName.Length)
Expand Down

0 comments on commit a2f97e2

Please sign in to comment.