[ps1] Move variable close to where it is set

This commit is contained in:
Alexander Karatarakis 2018-05-19 19:38:45 -07:00
parent b07568da41
commit 7932abed8d

View File

@ -5,7 +5,6 @@ param(
) )
Set-StrictMode -Version Latest Set-StrictMode -Version Latest
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
$vcpkgRootDir = $scriptsDir
$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName)
@ -34,6 +33,7 @@ function getProgramFiles32bit()
return $out return $out
} }
$vcpkgRootDir = $scriptsDir
while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root"))
{ {
Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root" Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root"