Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bliker/cmder
Browse files Browse the repository at this point in the history
  • Loading branch information
samvasko committed Apr 11, 2014
2 parents 97980f5 + 1b7e647 commit 38c13a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/utils.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
function Ensure-Exists ($path) {
if (-not (Test-Path $path)) {
Write-Error "Missing required $path file"
Write-Error "Missing required $path! Ensure it is installed"
exit 1
}
return $true > $null
}

function Ensure-Executable ($command) {
try { Get-Command $command -ErrorAction Stop > $null }
catch {
Write-Error "Missing $command! Ensure it is installed and on in the PATH"
exit 1
if( ($command -eq "7z") -and (Ensure-Exists "$env:programfiles\7-zip\7z.exe") ){
set-alias -Name "7z" -Value "$env:programfiles\7-zip\7z.exe" -Scope script
} else {
Write-Error "Missing $command! Ensure it is installed and on in the PATH"
exit 1
}
}
}

Expand Down

0 comments on commit 38c13a7

Please sign in to comment.