Skip to content

Commit

Permalink
Backup and restore ConEmu.xml on ./build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Sep 1, 2015
1 parent 7c907a5 commit eec3fd5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit eec3fd5

Please sign in to comment.