From eec3fd5578795e87b5e9a90f5e2bf4d021be71ef Mon Sep 17 00:00:00 2001 From: Maximus5 Date: Tue, 1 Sep 2015 20:05:57 +0300 Subject: [PATCH] Backup and restore ConEmu.xml on ./build.ps1 --- scripts/build.ps1 | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index cca62df..e1b2508 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -47,7 +47,10 @@ Param( [string]$launcher = "..\launcher", # Include git with the package build - [switch]$Full + [switch]$Full, + + # config folder location + [string]$config = "..\config" ) . "$PSScriptRoot\utils.ps1" @@ -61,6 +64,16 @@ Ensure-Exists $sourcesPath Ensure-Executable "7z" New-Item -Type Directory -Path (Join-Path $saveTo "/tmp/") -ErrorAction SilentlyContinue >$null +# Preserve modified (by user) ConEmu setting file +if ($config -ne "") { + $ConEmuXml = Join-Path $saveTo "conemu-maximus5\ConEmu.xml" + if (Test-Path $ConEmuXml -pathType leaf) { + $ConEmuXmlSave = Join-Path $config "ConEmu.xml" + Write-Verbose "Backup '$ConEmuXml' to '$ConEmuXmlSave'" + Copy-Item $ConEmuXml $ConEmuXmlSave + } else { $ConEmuXml = "" } +} else { $ConEmuXml = "" } + foreach ($s in $sources) { if($Full -eq $false -and $s.name -eq "msysgit"){ Continue @@ -83,6 +96,12 @@ foreach ($s in $sources) { "$($s.version)" | Out-File "$($s.name)/.cmderver" } +# Restore user configuration +if ($ConEmuXml -ne "") { + Write-Verbose "Restore '$ConEmuXmlSave' to '$ConEmuXml'" + Copy-Item $ConEmuXmlSave $ConEmuXml +} + Pop-Location Push-Location -Path $launcher