Skip to content

Commit

Permalink
(vscode.install) Switch vscode to github release check
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Bäriswyl committed Aug 24, 2023
1 parent 1d8b306 commit 0ce7e48
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions automatic/vscode.install/update.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import-module au
import-module "$PSScriptRoot\..\..\extensions\chocolatey-core.extension\extensions\chocolatey-core.psm1"

$releases32 = 'https://update.code.visualstudio.com/api/update/win32/stable/VERSION'
$releases64 = 'https://update.code.visualstudio.com/api/update/win32-x64/stable/VERSION'
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

if ($MyInvocation.InvocationName -ne '.') {
function global:au_BeforeUpdate {
Expand All @@ -25,18 +23,17 @@ function global:au_SearchReplace {
}

function global:au_GetLatest {
$json32 = Invoke-WebRequest -UseBasicParsing -Uri $releases32 | ConvertFrom-Json
$json64 = Invoke-WebRequest -UseBasicParsing -Uri $releases64 | ConvertFrom-Json

if ($json32.productVersion -ne $json64.productVersion) {
throw "Different versions for 32-Bit and 64-Bit detected."
}
$latestRelease = Get-GitHubRelease microsoft vscode
$version = $latestRelease.tag_name
# URLs are documented here: https://code.visualstudio.com/docs/supporting/faq#_previous-release-versions
$url32 = "https://update.code.visualstudio.com/$version/win32/stable"
$url64 = "https://update.code.visualstudio.com/$version/win32-x64/stable"

@{
Version = $json32.productVersion
RemoteVersion = $json32.productVersion
URL32 = $json32.Url
URL64 = $json64.Url
Version = $version
RemoteVersion = $version
URL32 = $url32
URL64 = $url64
}
}

Expand Down

0 comments on commit 0ce7e48

Please sign in to comment.