Skip to content

Commit 07fb26c

Browse files
authored
Merge pull request #1042 from daxgames/kill_ssh_agent
Added kill ssh-agent to build.ps1
2 parents f2641e4 + 13c474b commit 07fb26c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

scripts/build.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ Param(
5353
[switch]$Compile
5454
)
5555

56+
# Get the scripts and cmder root dirs we are building in.
57+
$ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
58+
$cmder_root = $ScriptRoot.replace("\scripts","")
59+
5660
# Dot source util functions into this scope
5761
. ".\utils.ps1"
5862
$ErrorActionPreference = "Stop"
@@ -75,6 +79,14 @@ if ($config -ne "") {
7579
} else { $ConEmuXml = "" }
7680
} else { $ConEmuXml = "" }
7781

82+
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
83+
foreach ($ssh_agent in $(get-process ssh-agent -erroraction silentlycontinue)) {
84+
if ([string]$($ssh_agent.path) -match [string]$cmder_root.replace('\','\\')) {
85+
write-verbose $("Stopping " + $ssh_agent.path + "!")
86+
stop-process $ssh_agent.id
87+
}
88+
}
89+
7890
$vend = $pwd
7991
foreach ($s in $sources) {
8092
Write-Verbose "Getting $($s.name) from URL $($s.url)"

scripts/utils.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function Delete-Existing ($path) {
2828
}
2929

3030
function Extract-Archive ($source, $target) {
31+
Write-Verbose $("Extracting Archive '$cmder_root\vendor\" + $source.replace('/','\') + " to '$cmder_root\vendor\$target'")
3132
Invoke-Expression "7z x -y -o`"$($target)`" `"$source`" > `$null"
3233
if ($lastexitcode -ne 0) {
3334
Write-Error "Extracting of $source failied"

0 commit comments

Comments
 (0)