Skip to content

Commit

Permalink
Update install to create $PROFILE before checking if git command exis…
Browse files Browse the repository at this point in the history
…ts, to make adding an alias easier
  • Loading branch information
dahlbyk committed Jan 27, 2012
1 parent f677870 commit c12b7cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions install.ps1
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit c12b7cc

Please sign in to comment.