File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3541,3 +3541,23 @@ function Clear-NativeDependencies
35413541
35423542 $deps | ConvertTo-Json - Depth 20 | Set-Content " $PublishFolder /pwsh.deps.json" - Force
35433543}
3544+
3545+
3546+ function Update-DotNetSdkVersion {
3547+ $globalJsonPath = " $PSScriptRoot /global.json"
3548+ $globalJson = get-content $globalJsonPath | convertfrom-json
3549+ $oldVersion = $globalJson.sdk.version
3550+ $versionParts = $oldVersion -split ' \.'
3551+ $channel = $versionParts [0 ], $versionParts [1 ] -join ' .'
3552+ Write-Verbose " channel: $channel " - Verbose
3553+ $azure_feed = ' https://dotnetcli.azureedge.net/dotnet'
3554+ $version_file_url = " $azure_feed /Sdk/$channel /latest.version"
3555+ $version = Invoke-RestMethod $version_file_url
3556+ Write-Verbose " updating from: $oldVersion to: $version " - Verbose
3557+ $globalJson.sdk.version = $version
3558+ $globalJson | convertto-json | out-file $globalJsonPath
3559+ $dotnetRuntimeMetaPath = " $psscriptroot \DotnetRuntimeMetadata.json"
3560+ $dotnetRuntimeMeta = get-content $dotnetRuntimeMetaPath | convertfrom-json
3561+ $dotnetRuntimeMeta.sdk.sdkImageVersion = $version
3562+ $dotnetRuntimeMeta | ConvertTo-Json | Out-File $dotnetRuntimeMetaPath
3563+ }
You can’t perform that action at this time.
0 commit comments