From b9ecde1340f75c1e8de7031a8786cb47208f6d34 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 1 Aug 2023 03:34:56 +0200 Subject: [PATCH] Allow creation of backups without specifying 7z arguments --- scripts/Windows/Scripts/Context.ps1 | 4 ++++ scripts/Windows/Software/PuTTY/Manage.ps1 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 7d1078c5..a92f237b 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -146,6 +146,10 @@ class Context { return $this.ArchivePath($softwareName); } + [void] Backup([string]$sourcePath, [string]$archivePath) { + $this.Backup($sourcePath, $archivePath, @()); + } + [void] Backup([string]$sourcePath, [string]$archivePath, [string[]]$arguments) { if (Test-Path $archivePath) { Remove-Item -Recurse $archivePath; diff --git a/scripts/Windows/Software/PuTTY/Manage.ps1 b/scripts/Windows/Software/PuTTY/Manage.ps1 index 37cfa809..bf3010d4 100644 --- a/scripts/Windows/Software/PuTTY/Manage.ps1 +++ b/scripts/Windows/Software/PuTTY/Manage.ps1 @@ -10,7 +10,7 @@ $null = New-Module { $tempDir = $context.GetTempDirectory(); $fileName = Join-Path "$tempDir" $configFile; & reg export "HKCU\Software\SimonTatham" "$fileName" /y; - $context.Backup($tempDir, $context.SoftwareArchive($softwareName), @()); + $context.Backup($tempDir, $context.SoftwareArchive($softwareName)); Remove-Item -Recurse $tempDir; }