SceneSwitcher/.github/scripts/utils.pwsh/Check-Git.ps1
WarmUpTill aef29d7d82 Update plugin build scripts
Based on OBS plugin template build scripts with some minor adjustments:

 * Adjust format check scripts to exclude ./deps folder
 * Adjust release scripts to only draft releases
 * Always build installers
 * Always upload build artefacts
 * Build opencv for Mac and Windows releases
2022-08-17 11:08:53 -07:00

26 lines
698 B
PowerShell

function Check-Git {
<#
.SYNOPSIS
Ensures available git executable on host system.
.DESCRIPTION
Checks whether a git command is available on the host system. If none is found,
Git is installed via winget.
.EXAMPLE
Check-Git
#>
if ( ! ( Test-Path function:Log-Info ) ) {
. $PSScriptRoot/Logger.ps1
}
Log-Information 'Checking for Git executable...'
if ( ! ( Get-Command git ) ) {
Log-Warning 'No Git executable found. Will try to install via winget.'
winget install git
} else {
Log-Debug "Git found at $(Get-Command git)."
Log-Status "Git found."
}
}