From: AJ ONeal Date: Sat, 12 Sep 2020 04:09:50 +0000 (+0000) Subject: test and fix caddy on Windows X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=faf542c439751d79dc6b52130c9456196de85cd8;p=webi-installers%2F.git test and fix caddy on Windows --- diff --git a/caddy/install.ps1 b/caddy/install.ps1 index cb95876..f8fddb7 100644 --- a/caddy/install.ps1 +++ b/caddy/install.ps1 @@ -8,6 +8,7 @@ $pkg_cmd_name = "caddy" $pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\caddy.exe" +$pkg_dst_bin = "$Env:USERPROFILE\.local\bin" $pkg_dst = "$pkg_dst_cmd" $pkg_src_cmd = "$Env:USERPROFILE\.local\opt\caddy-v$Env:WEBI_VERSION\bin\caddy.exe" @@ -40,12 +41,11 @@ IF (!(Test-Path -Path "$pkg_src_cmd")) { # Windows BSD-tar handles zip. Imagine that. echo "Unpacking $pkg_download" & tar xf "$pkg_download" - & dir # Settle unpacked archive into place echo "Install Location: $pkg_src_cmd" - New-Item "$pkg_src_bin" -ItemType Directory - Move-Item -Path ".\caddy-*\caddy.exe" -Destination "$pkg_src_bin" + New-Item "$pkg_src_bin" -ItemType Directory -Force + Move-Item -Path ".\caddy.exe" -Destination "$pkg_src_bin" # Exit tmp popd @@ -53,4 +53,5 @@ IF (!(Test-Path -Path "$pkg_src_cmd")) { echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'" Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore +New-Item "$pkg_dst_bin" -ItemType Directory -Force Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse