mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-23 02:14:55 -05:00
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
30 lines
716 B
PowerShell
30 lines
716 B
PowerShell
function Ensure-Location {
|
|
<#
|
|
.SYNOPSIS
|
|
Ensures current location to be set to specified directory.
|
|
.DESCRIPTION
|
|
If specified directory exists, switch to it. Otherwise create it,
|
|
then switch.
|
|
.EXAMPLE
|
|
Ensure-Location "My-Directory"
|
|
Ensure-Location -Path "Path-To-My-Directory"
|
|
#>
|
|
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
[string] $Path
|
|
)
|
|
|
|
if ( ! ( Test-Path $Path ) ) {
|
|
$_Params = @{
|
|
ItemType = "Directory"
|
|
Path = ${Path}
|
|
ErrorAction = "SilentlyContinue"
|
|
}
|
|
|
|
New-Item @_Params | Set-Location
|
|
} else {
|
|
Set-Location -Path ${Path}
|
|
}
|
|
}
|