Updated the scripts

This commit is contained in:
Markus Fleschutz 2021-02-22 08:19:03 +01:00
parent a9d32e160c
commit 8a0489ff5f
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ try {
$URL = $Row.URL $URL = $Row.URL
$Directory = $Row.Directory $Directory = $Row.Directory
write-output "" write-output ""
if (Test-Path($Directory)) { if (Test-Path $Directory) {
write-output "Skipping existing $Directory ..." write-output "Skipping existing $Directory ..."
continue continue
} }

View File

@ -52,13 +52,13 @@ if ($Filename -eq "") {
} }
write-output "Reading $Filename ..." write-output "Reading $Filename ..."
$file = get-item $Filename $file = get-item $Filename
if (!(Test-Path($file.DirectoryName+"\"+$file.Name+".zip"))) { if (-not(Test-Path $file.DirectoryName+"\"+$file.Name+".zip")) {
$zipFile = $file.DirectoryName+"\"+$file.Name+".zip" $zipFile = $file.DirectoryName+"\"+$file.Name+".zip"
$file.CopyTo($zipFile) $file.CopyTo($zipFile)
} }
$destination = $file.DirectoryName+"\"+$file.Name.Replace($file.Extension,"") $destination = $file.DirectoryName+"\"+$file.Name.Replace($file.Extension,"")
if (!(Test-Path($destination))) { if (-not(Test-Path $destination)) {
md $destination md $destination
UnzipFile -file $zipFile -dest $destination UnzipFile -file $zipFile -dest $destination
} }
@ -72,7 +72,7 @@ $progress = $null
foreach($item in $content.package.manifest.Item) { foreach($item in $content.package.manifest.Item) {
if ($item."media-type" -eq "application/xhtml+xml") { if ($item."media-type" -eq "application/xhtml+xml") {
if (Test-Path($bookPath+"\progress.txt")) { if (Test-Path $bookPath+"\progress.txt") {
$progress = Get-Content $bookPath"\progress.txt" $progress = Get-Content $bookPath"\progress.txt"
$progress = $progress.Split(",") $progress = $progress.Split(",")
} }