diff --git a/src/utils/downloadGit.mts b/src/utils/downloadGit.mts index 9b849dc..fb8011c 100644 --- a/src/utils/downloadGit.mts +++ b/src/utils/downloadGit.mts @@ -10,14 +10,15 @@ import { unxzFile, unzipFile } from "./downloadHelpers.mjs"; import { unknownErrorToString } from "./errorHelper.mjs"; import { EXT_USER_AGENT, + WINDOWS_ARM64_GIT_DOWNLOAD_URL, WINDOWS_X86_GIT_DOWNLOAD_URL, } from "./sharedConstants.mjs"; /** * Downloads and installs a portable version of Git. * - * Supports Windows x64 and macOS x64 + arm64. - * But currently only execution on Windows x64 is enabled. + * Supports Windows x64 + arm64 and macOS x64 + arm64. + * But currently only execution on Windows x64 and Windows arm64 is enabled. * * @returns The path to the installed Git executable or undefined if the installation failed */ @@ -26,7 +27,7 @@ export async function downloadGit( ): Promise { if ( process.platform !== "win32" || - (process.platform === "win32" && process.arch !== "x64") + (process.arch !== "x64" && process.arch !== "arm64") ) { Logger.debug( LoggerSource.gitDownloader, @@ -51,8 +52,12 @@ export async function downloadGit( // Ensure the target directory exists await mkdir(targetDirectory, { recursive: true }); - // select download url for platform()_arch() - const downloadUrl = redirectURL ?? WINDOWS_X86_GIT_DOWNLOAD_URL; + // select download url + const downloadUrl = + redirectURL ?? + (process.arch === "arm64" + ? WINDOWS_ARM64_GIT_DOWNLOAD_URL + : WINDOWS_X86_GIT_DOWNLOAD_URL); const tmpBasePath = join(tmpdir(), "pico-sdk"); await mkdir(tmpBasePath, { recursive: true }); diff --git a/src/utils/sharedConstants.mts b/src/utils/sharedConstants.mts index 2b118c9..b4ae6e3 100644 --- a/src/utils/sharedConstants.mts +++ b/src/utils/sharedConstants.mts @@ -9,7 +9,10 @@ export const OPENOCD_VERSION = "0.12.0+dev"; export const WINDOWS_X86_GIT_DOWNLOAD_URL = "https://github.com/git-for-windows/git/releases/download" + - "/v2.51.0.windows.2/MinGit-2.51.0.2-64-bit.zip"; + "/v2.51.2.windows.1/MinGit-2.51.2-64-bit.zip"; +export const WINDOWS_ARM64_GIT_DOWNLOAD_URL = + "https://github.com/git-for-windows/git/releases/download" + + "/v2.51.2.windows.1/MinGit-2.51.2-arm64.zip"; export const EXAMPLES_REPOSITORY_URL = "https://github.com/raspberrypi/pico-examples.git";