Skip to content

Commit

Permalink
Add Chocolatey uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Jan 27, 2017
1 parent 1bff495 commit 91f0196
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions chocolatey/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
Write-Host "Could not remove `'$poshgitPath`'"
}

$poshGitInstall = if ($env:poshGit ) { $env:poshGit } else { 'https://github.com/dahlbyk/posh-git/zipball/master' }
Install-ChocolateyZipPackage 'poshgit' $poshGitInstall $poshgitPath
$currentVersionPath = Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select-Object -Last 1

if(Test-Path $PROFILE) {
$oldProfile = @(Get-Content $PROFILE)

Expand All @@ -24,9 +20,10 @@
$newProfile = @()
foreach($line in $oldProfile) {
if ($line -like '*PoshGitPrompt*') { continue; }
if ($line -like '*Load posh-git example profile*') { continue; }

if($line -like '. *posh-git*profile.example.ps1*') {
$line = ". '$currentVersionPath\profile.example.ps1'"
continue;
}
$newProfile += $line
}
Expand Down

0 comments on commit 91f0196

Please sign in to comment.