Skip to content

Commit

Permalink
bug: check/create magick dir
Browse files Browse the repository at this point in the history
Check and create magick dir before expanding the portable version.
  • Loading branch information
fscorrupt committed Jul 23, 2024
1 parent 63d55f5 commit 8ccd77b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Posterizarr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
[string]$mediatype
)

$CurrentScriptVersion = "1.2.41"
$CurrentScriptVersion = "1.2.42"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -2779,6 +2779,12 @@ function CheckImageMagick {
$LatestRelease = ($result.links.href | Where-Object { $_ -like '*portable-Q16-HDRI-x64.zip' } | Sort-Object -Descending)[0]
$DownloadPath = Join-Path -Path $global:ScriptRoot -ChildPath (Join-Path -Path 'temp' -ChildPath $LatestRelease)
Invoke-WebRequest "https://imagemagick.org/archive/binaries/$LatestRelease" -OutFile $DownloadPath

# Ensure the $magickinstalllocation directory exists
if (-not (Test-Path -LiteralPath $magickinstalllocation)) {
New-Item -ItemType Directory -Path $magickinstalllocation | Out-Null
}

Expand-Archive -Path $DownloadPath -DestinationPath $magickinstalllocation -Force
if ((Get-ChildItem -Directory -LiteralPath $magickinstalllocation).name -eq $($LatestRelease.replace('.zip', ''))) {
Copy-item -Force -Recurse "$magickinstalllocation\$((Get-ChildItem -Directory -LiteralPath $magickinstalllocation).name)\*" $magickinstalllocation
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.41
1.2.42

0 comments on commit 8ccd77b

Please sign in to comment.