stop ssh agent only if building vendors

This commit is contained in:
David Refoua 2022-10-17 19:52:15 +03:30
parent 7995f34981
commit 71536ddddf
2 changed files with 10 additions and 10 deletions

View File

@ -53,7 +53,7 @@ Param(
# Config folder location # Config folder location
[string]$config = "$PSScriptRoot\..\config", [string]$config = "$PSScriptRoot\..\config",
# Using this option will skip all downloads and only build launcher # Using this option will skip all downloads, if you only need to build launcher
[switch]$noVendor, [switch]$noVendor,
# Build launcher if you have MSBuild tools installed # Build launcher if you have MSBuild tools installed
@ -67,14 +67,6 @@ $cmder_root = Resolve-Path "$PSScriptRoot\.."
. "$PSScriptRoot\utils.ps1" . "$PSScriptRoot\utils.ps1"
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
foreach ($ssh_agent in $(Get-Process ssh-agent -ErrorAction SilentlyContinue)) {
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\','\\')) {
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
Stop-Process $ssh_agent.id
}
}
if ($Compile) { if ($Compile) {
# Check for requirements # Check for requirements
Ensure-Executable "msbuild" Ensure-Executable "msbuild"
@ -119,6 +111,14 @@ if (-Not $noVendor) {
} else { $ConEmuXml = "" } } else { $ConEmuXml = "" }
} else { $ConEmuXml = "" } } else { $ConEmuXml = "" }
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
foreach ($ssh_agent in $(Get-Process ssh-agent -ErrorAction SilentlyContinue)) {
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\','\\')) {
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
Stop-Process $ssh_agent.id
}
}
foreach ($s in $sources) { foreach ($s in $sources) {
Write-Verbose "Getting vendored $($s.name) $($s.version)..." Write-Verbose "Getting vendored $($s.name) $($s.version)..."

View File

@ -92,7 +92,7 @@ function Get-GHTempPath {
return $temp return $temp
} }
function Get-VersionStr() { function Get-VersionStr {
# Clear existing variable # Clear existing variable
if ($string) { Clear-Variable -name string } if ($string) { Clear-Variable -name string }