mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-16 06:37:54 +08:00
added kill ssh-agent to build.ps1
This commit is contained in:
@ -53,6 +53,10 @@ Param(
|
||||
[switch]$Compile
|
||||
)
|
||||
|
||||
# Get the scripts and cmder root dirs we are building in.
|
||||
$ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
|
||||
$cmder_root = $ScriptRoot.replace("\scripts","")
|
||||
|
||||
# Dot source util functions into this scope
|
||||
. ".\utils.ps1"
|
||||
$ErrorActionPreference = "Stop"
|
||||
@ -75,6 +79,14 @@ if ($config -ne "") {
|
||||
} 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
|
||||
}
|
||||
}
|
||||
|
||||
$vend = $pwd
|
||||
foreach ($s in $sources) {
|
||||
Write-Verbose "Getting $($s.name) from URL $($s.url)"
|
||||
|
Reference in New Issue
Block a user