From 4bacea58f1cada952a0350691a6bcbafb28ad691 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Sep 2020 10:45:27 -0400 Subject: [PATCH] - fixes a bug where parameters docs would fail the script --- Scripts/getLatestVersion.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/getLatestVersion.ps1 b/Scripts/getLatestVersion.ps1 index ca1806b62..4e935336b 100644 --- a/Scripts/getLatestVersion.ps1 +++ b/Scripts/getLatestVersion.ps1 @@ -7,16 +7,16 @@ .Description Retrieves the latest version specified in the Gradle.Properties file Uses the retrieved values to update the enviornment variable VERSION_STRING -#> - .Parameter propertiesPath - +#> Param( - [parameter(Mandatory = $true)] [string]$propertiesPath ) #Retrieve the current version from the Gradle.Properties file given the specified path +if($propertiesPath -eq "" -or $null -eq $propertiesPath) { + $propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties" +} $file = get-item $propertiesPath $findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2 $findVersions = $findVersions -split "`r`n"