Permalink
Browse files

Update install to create $PROFILE before checking if git command exis…

…ts, to make adding an alias easier
  • Loading branch information...
1 parent f677870 commit c12b7cc46ecdafcba9fcc28302fa76054519a7d0 @dahlbyk committed Jan 27, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 install.ps1
View
@@ -5,6 +5,11 @@ if($PSVersionTable.PSVersion.Major -lt 2) {
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
@@ -15,11 +20,6 @@ if(!(. (Join-Path $installDir "CheckVersion.ps1"))) {
return
}
-if(!(Test-Path $PROFILE)) {
- Write-Host "Creating PowerShell profile...`n$PROFILE"
- New-Item $PROFILE -Force -Type File -ErrorAction Stop -WhatIf:$WhatIf > $null
-}
-
# Adapted from http://www.west-wind.com/Weblog/posts/197245.aspx
function Get-FileEncoding($Path) {
$bytes = [byte[]](Get-Content $Path -Encoding byte -ReadCount 4 -TotalCount 4)

0 comments on commit c12b7cc

Please sign in to comment.