From c4dfeb409e7b40fe8bb0fa084a2895d2ae0aa616 Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Tue, 26 Nov 2024 14:52:26 +0100 Subject: [PATCH] update-git: support arm64 Git for Windows added support for arm64 releases in their 2.47.1 version. Let's add support for it in the `update-git.ts` script. Ref: https://github.com/git-for-windows/git/releases/tag/v2.47.1.windows.1 Ref: https://github.com/git-for-windows/git/issues/3107#issuecomment-2498275856 Signed-off-by: Dennis Ameling Signed-off-by: Dennis Ameling --- script/update-git.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/script/update-git.ts b/script/update-git.ts index bda147c..712cc45 100644 --- a/script/update-git.ts +++ b/script/update-git.ts @@ -74,9 +74,13 @@ async function getLatestStableRelease() { async function getPackageDetails( assets: ReleaseAssets, body: string, - arch: string + arch: 'amd64' | 'x86' | 'arm64' ) { - const archValue = arch === 'amd64' ? '64-bit' : '32-bit' + const archValue = { + amd64: '64-bit', + x86: '32-bit', + arm64: 'arm64', + }[arch] const minGitFile = assets.find( a => a.name.indexOf('MinGit') !== -1 && a.name.indexOf(archValue) !== -1 @@ -181,12 +185,13 @@ async function run() { const package64bit = await getPackageDetails(assets, body, 'amd64') const package32bit = await getPackageDetails(assets, body, 'x86') + const packagearm64 = await getPackageDetails(assets, body, 'arm64') - if (package64bit == null || package32bit == null) { + if (package64bit == null || package32bit == null || packagearm64 == null) { return } - updateGitDependencies(latestGitVersion, [package64bit, package32bit]) + updateGitDependencies(latestGitVersion, [package64bit, package32bit, packagearm64]) console.log( `✅ Updated dependencies metadata to Git ${latestGitVersion} (Git for Windows ${version})`