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

Removes ssh utils #585

Merged
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
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; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm... I was going to say we should leave this, to clean up after old versions, but this uninstall script will only be used for 1.0+ which will have no responsibility for Start-SshAgent...so I think it's fine to go? Thoughts?

Copy link
Collaborator Author

@JeremySkinner JeremySkinner Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think it's fine to go


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