From 87e703ab950d10ac5908ae2062e89ea75c71dc49 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Wed, 14 Jun 2023 12:13:20 +0100 Subject: [PATCH] Add exclusions to 7z command --- ue-plugin-package.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ue-plugin-package.ps1 b/ue-plugin-package.ps1 index 322503c..d88c39f 100644 --- a/ue-plugin-package.ps1 +++ b/ue-plugin-package.ps1 @@ -165,6 +165,8 @@ try { # Zip parent of the uplugin folder $zipsrc = (Get-Item $pluginfile).Directory.FullName $zipdst = Join-Path $config.OutputDir "$($pluginName)_$($versionNumber).zip" + $excludefilename = "packageexclusions.txt" + $excludefile = Join-Path $zipsrc $excludefilename New-Item -ItemType Directory -Path $config.OutputDir -Force > $null Write-Output "Compressing to $zipdst" @@ -172,6 +174,18 @@ try { $argList = [System.Collections.ArrayList]@() $argList.Add("a") > $null $argList.Add($zipdst) > $null + # Standard exclusions + $argList.Add("-x!$pluginName\.git\") > $null + $argList.Add("-x!$pluginName\.git*") > $null + $argList.Add("-x!$pluginName\Binaries\") > $null + $argList.Add("-x!$pluginName\Intermediate\") > $null + $argList.Add("-x!$pluginName\pluginconfig.json") > $null + + if (Test-Path $excludefile) { + $argList.Add("-x@`"$excludefile`"") > $null + $argList.Add("-x!$pluginName\$excludefilename") > $null + } + $argList.Add($zipsrc) > $null if ($dryrun) {