-
-
Notifications
You must be signed in to change notification settings - Fork 812
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from dahlbyk/rkeithhill/migrate-core-files-to…
…-src-dir Simplify install.ps1 and move core module files under src/
- Loading branch information
Showing
17 changed files
with
26 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,6 @@ | ||
param([switch]$WhatIf = $false) | ||
|
||
# Dot source for Get-FileEncoding | ||
$installDir = Split-Path $MyInvocation.MyCommand.Path -Parent | ||
. $installDir\Utils.ps1 | ||
|
||
if($PSVersionTable.PSVersion.Major -lt 2) { | ||
Write-Warning "posh-git requires PowerShell 2.0 or better; you have version $($Host.Version)." | ||
return | ||
} | ||
|
||
if(!(Test-Path $PROFILE)) { | ||
Write-Host "Creating PowerShell profile...`n$PROFILE" | ||
New-Item $PROFILE -Force -Type File -ErrorAction Stop -WhatIf:$WhatIf > $null | ||
} | ||
|
||
if(!(Get-Command git -ErrorAction SilentlyContinue)) { | ||
Write-Warning 'Could not find git command. Please create a git alias or add %ProgramFiles%\Git\cmd to PATH.' | ||
return | ||
} | ||
|
||
if(!(. (Join-Path $installDir "CheckVersion.ps1"))) { | ||
return | ||
} | ||
|
||
$profileLine = ". '$installDir\profile.example.ps1'" | ||
if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) { | ||
Write-Host "It seems posh-git is already installed..." | ||
return | ||
} | ||
|
||
Write-Host "Adding posh-git to profile..." | ||
@" | ||
# Load posh-git example profile | ||
$profileLine | ||
"@ | Out-File $PROFILE -Append -WhatIf:$WhatIf -Encoding (Get-FileEncoding $PROFILE) | ||
|
||
Write-Host 'posh-git sucessfully installed!' | ||
Write-Host 'Please reload your profile for the changes to take effect:' | ||
Write-Host ' . $PROFILE' | ||
Import-Module $installDir\src\posh-git.psd1 | ||
Add-PoshGitToProfile -WhatIf:$WhatIf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters