Skip to content

Commit

Permalink
Merge pull request #585 from JeremySkinner/feature/split-ssh-into-sep…
Browse files Browse the repository at this point in the history
…arate-module

Removes ssh utils
  • Loading branch information
dahlbyk authored Jul 6, 2018
2 parents b428c3c + 01e1c87 commit 3dd9fdc
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 295 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# posh-git Release History

## 1.0.0-beta3 - June 14, 2018

- Moved SSH agent functionality to <https://github.com/dahlbyk/posh-sshell>.

## 1.0.0-beta2 - May 13, 2018

The 1.0.0 release is targeted specifically at Windows PowerShell 5.x and (cross-platform) PowerShell Core 6.x, both of
Expand Down
1 change: 0 additions & 1 deletion chocolatey/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
foreach($line in $oldProfile) {
if ($line -like '*PoshGitPrompt*') { continue; }
if ($line -like '*Load posh-git example profile*') { continue; }
if ($line -like '*Start-SshAgent*') { continue; }

if($line -like '. *posh-git*profile.example.ps1*') {
continue;
Expand Down
4 changes: 1 addition & 3 deletions profile.example.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ else {
# Example:
# $Global:GitPromptSettings.BranchBehindAndAheadDisplay = "Compact"

Start-SshAgent -Quiet

if ($args[0] -ne 'choco') {
Write-Warning "posh-git's profile.example.ps1 will be removed in a future version."
Write-Warning "Consider using `Add-PoshGitToProfile -StartSshAgent` instead."
Write-Warning "Consider using `Add-PoshGitToProfile` instead."
}
229 changes: 0 additions & 229 deletions src/SshUtils.ps1

This file was deleted.

9 changes: 0 additions & 9 deletions src/Utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ function Test-Administrator {
.PARAMETER Force
Do not check if the specified profile script is already importing
posh-git. Just add Import-Module posh-git command.
.PARAMETER StartSshAgent
Also add `Start-SshAgent -Quiet` to the specified profile script.
.EXAMPLE
PS C:\> Add-PoshGitToProfile
Updates your profile script for the current PowerShell host to import the
Expand Down Expand Up @@ -116,10 +114,6 @@ function Add-PoshGitToProfile {
[switch]
$Force,

[Parameter()]
[switch]
$StartSshAgent,

[Parameter(ValueFromRemainingArguments)]
[psobject[]]
$TestParams
Expand Down Expand Up @@ -223,9 +217,6 @@ function Add-PoshGitToProfile {
if ($PSCmdlet.ShouldProcess($profilePath, "Add 'Import-Module posh-git' to profile")) {
Add-Content -LiteralPath $profilePath -Value $profileContent -Encoding UTF8
}
if ($StartSshAgent -and $PSCmdlet.ShouldProcess($profilePath, "Add 'Start-SshAgent -Quiet' to profile")) {
Add-Content -LiteralPath $profilePath -Value 'Start-SshAgent -Quiet' -Encoding UTF8
}
}

<#
Expand Down
5 changes: 0 additions & 5 deletions src/posh-git.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ FunctionsToExport = @(
'Write-GitWorkingDirStatusSummary',
'Write-Prompt',
'Write-VcsStatus',
'Get-SshAgent',
'Start-SshAgent',
'Stop-SshAgent',
'Add-SshKey',
'Get-SshPath',
'TabExpansion',
'tgit'
)
Expand Down
6 changes: 0 additions & 6 deletions src/posh-git.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ param([switch]$NoVersionWarn, [switch]$ForcePoshGitPrompt)
. $PSScriptRoot\GitParamTabExpansion.ps1
. $PSScriptRoot\GitTabExpansion.ps1
. $PSScriptRoot\TortoiseGit.ps1
. $PSScriptRoot\SshUtils.ps1

if (!$Env:HOME) { $Env:HOME = "$Env:HOMEDRIVE$Env:HOMEPATH" }
if (!$Env:HOME) { $Env:HOME = "$Env:USERPROFILE" }
Expand Down Expand Up @@ -206,11 +205,6 @@ $exportModuleMemberParams = @{
'Write-GitWorkingDirStatusSummary',
'Write-Prompt',
'Write-VcsStatus',
'Get-SshAgent',
'Start-SshAgent',
'Stop-SshAgent',
'Add-SshKey',
'Get-SshPath',
'TabExpansion',
'tgit'
)
Expand Down
25 changes: 0 additions & 25 deletions test/Ssh.Tests.ps1

This file was deleted.

17 changes: 0 additions & 17 deletions test/Utils.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,6 @@ New-Alias pscore C:\Users\Keith\GitHub\rkeithhill\PowerShell\src\powershell-win-
$nativeContent += "${newLine}${newLine}Import-Module posh-git"
$content -join $newLine | Should BeExactly $nativeContent
}
It 'Adds Start-SshAgent if posh-git is not installed' {
Add-PoshGitToProfile $profilePath -StartSshAgent

Test-Path -LiteralPath $profilePath | Should Be $true
$last = Get-Content $profilePath | Select-Object -Last 1
$last | Should BeExactly "Start-SshAgent -Quiet"
}
It 'Does not add Start-SshAgent if posh-git is installed' {
$profileContent = 'Import-Module posh-git'
Set-Content $profilePath -Value $profileContent

Add-PoshGitToProfile $profilePath -StartSshAgent

Test-Path -LiteralPath $profilePath | Should Be $true
$content = Get-Content $profilePath
$content | Should BeExactly $profileContent
}
}

Context 'Test-PoshGitImportedInScript Tests' {
Expand Down

0 comments on commit 3dd9fdc

Please sign in to comment.