Skip to content

Commit

Permalink
Merge pull request #522 from theofficialgman/main
Browse files Browse the repository at this point in the history
add ARM64, ARM32, and x86 Linux to update-embedded-git
  • Loading branch information
sergiou87 committed Mar 15, 2023
2 parents c90fd30 + 130854b commit 6fd1619
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions script/update-embedded-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ get(`https://api.github.com/repos/desktop/dugite-native/releases/latest`).then(
'win32-ia32': await findWindows32BitRelease(assets),
'darwin-x64': await findMacOSx64BitRelease(assets),
'darwin-arm64': await findMacOSARM64BitRelease(assets),
'linux-x64': await findLinux64BitRelease(assets)
'linux-x64': await findLinux64BitRelease(assets),
'linux-x86': await findLinux32BitRelease(assets),
'linux-arm': await findLinuxARM32BitRelease(assets),
'linux-arm64': await findLinuxARM64BitRelease(assets)
}

const fileContents = JSON.stringify(output, null, 2)
Expand Down Expand Up @@ -67,13 +70,37 @@ function findMacOSARM64BitRelease(assets) {
}

function findLinux64BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-ubuntu.tar.gz'))
const asset = assets.find(a => a.name.endsWith('-ubuntu-x64.tar.gz'))
if (asset == null) {
throw new Error('Could not find Linux 64-bit archive in latest release')
}
return getDetailsForAsset(assets, asset)
}

function findLinux32BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-ubuntu-x86.tar.gz'))
if (asset == null) {
throw new Error('Could not find Linux 32-bit archive in latest release')
}
return getDetailsForAsset(assets, asset)
}

function findLinuxARM64BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-ubuntu-arm64.tar.gz'))
if (asset == null) {
throw new Error('Could not find Linux 64-bit archive in latest release')
}
return getDetailsForAsset(assets, asset)
}

function findLinuxARM32BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-ubuntu-arm.tar.gz'))
if (asset == null) {
throw new Error('Could not find Linux 32-bit archive in latest release')
}
return getDetailsForAsset(assets, asset)
}

async function getDetailsForAsset(assets, currentAsset) {
const { name } = currentAsset
const url = currentAsset.browser_download_url
Expand Down

0 comments on commit 6fd1619

Please sign in to comment.