Skip to content

Commit

Permalink
update-git: support arm64
Browse files Browse the repository at this point in the history
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: git-for-windows/git#3107 (comment)
Signed-off-by: Dennis Ameling <[email protected]>
  • Loading branch information
dennisameling committed Nov 26, 2024
1 parent da7def2 commit fef37b8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions script/update-git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})`
Expand Down

0 comments on commit fef37b8

Please sign in to comment.