Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added kill ssh-agent to build.ps1 #1042

Merged
merged 1 commit into from
Jul 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)"
Expand Down
1 change: 1 addition & 0 deletions scripts/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Delete-Existing ($path) {
}

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