From b6b4c5fd974d40fe60ec59c3c81ba8ae4b8ca302 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 23 Aug 2023 16:43:00 +0100 Subject: [PATCH] move $target out of loop -Force compress archive if it exists --- build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 572bc4f..61b4e02 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,7 +1,7 @@ function Compress-Builds { + $target = Join-Path -Path $PSScriptRoot -ChildPath "dist" @("basic", "banana", "potato") | ForEach-Object { - $target = Join-Path -Path $PSScriptRoot -ChildPath "dist" - Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip") + Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip") -Force } }