@@ -288,6 +288,13 @@ private static ExitCodes OnGetVersionCommand(string projectPath, string format,
288288 }
289289
290290 var oracle = new VersionOracle ( searchPath , repository , commit , CloudBuild . Active ) ;
291+
292+ // Take the PublicRelease environment variable into account, since the build would as well.
293+ if ( ! string . IsNullOrWhiteSpace ( Environment . GetEnvironmentVariable ( "PublicRelease" ) ) && bool . TryParse ( Environment . GetEnvironmentVariable ( "PublicRelease" ) , out bool publicRelease ) )
294+ {
295+ oracle . PublicRelease = publicRelease ;
296+ }
297+
291298 if ( string . IsNullOrEmpty ( singleVariable ) )
292299 {
293300 switch ( format . ToLowerInvariant ( ) )
@@ -576,7 +583,7 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer
576583 }
577584
578585 // nextVersion and versionIncrement parameters cannot be combined
579- if ( ! string . IsNullOrEmpty ( nextVersion ) && ! string . IsNullOrEmpty ( versionIncrement ) )
586+ if ( ! string . IsNullOrEmpty ( nextVersion ) && ! string . IsNullOrEmpty ( versionIncrement ) )
580587 {
581588 Console . Error . WriteLine ( "Options 'nextVersion' and 'versionIncrement' cannot be used at the same time." ) ;
582589 return ExitCodes . InvalidParameters ;
@@ -586,7 +593,7 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer
586593 VersionOptions . ReleaseVersionIncrement ? versionIncrementParsed = default ;
587594 if ( ! string . IsNullOrEmpty ( versionIncrement ) )
588595 {
589- if ( ! Enum . TryParse < VersionOptions . ReleaseVersionIncrement > ( versionIncrement , true , out var parsed ) )
596+ if ( ! Enum . TryParse < VersionOptions . ReleaseVersionIncrement > ( versionIncrement , true , out var parsed ) )
590597 {
591598 Console . Error . WriteLine ( $ "\" { versionIncrement } \" is not a valid version increment") ;
592599 return ExitCodes . InvalidVersionIncrement ;
0 commit comments