Skip to content

Commit

Permalink
ps is not bash - correcting
Browse files Browse the repository at this point in the history
  • Loading branch information
rupor-github committed Oct 22, 2016
1 parent 6ad37a6 commit 6d327e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/fb2_flibusta.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@ if( $LASTEXITCODE -eq 0 ) { Write-Output "No archive updates..."; Power-Balanced

# Clean old database directories - we have at least one good download
$old_dbs = Join-Path $archive_path "flibusta_*"
Get-ChildItem $old_dbs | Where-Object {$_.PSIsContainer -eq $True} | sort CreationTime -desc | select -Skip 5 | Remove-Item -Recurse -Force
Get-ChildItem $old_dbs | Where-Object {$_.PSIsContainer -eq $True} | sort CreationTime -desc | select -Skip 5 | Remove-Item -Recurse -Force

$new_full_archives = 0
$before_dir = @(Join-path $adir "fb2-*.zip" | dir)

& $mydir/libmerge --verbose --keep-updates --destination $adir;$udir 2>&1 | Write-Host
& $mydir/libmerge --verbose --keep-updates --destination ($adir + ";" + $udir) 2>&1 | Write-Host

if( $LASTEXITCODE -gt 0 ) { Write-Error "LIBMERGE error - $LASTEXITCODE !"; Power-Balanced; exit 0 }

# Clean updates leaving last ones so libget2 would not download unnesessary updates next time
Get-ChildItem $udir | sort Name -desc | select -Skip 10 | Remove-Item -Force

$after_dir = @(Join-path $adir "fb2-*.zip" | dir)
$diff_dir = Compare-Object $before_dir $after_dir

Expand Down

0 comments on commit 6d327e9

Please sign in to comment.