@@ -10,14 +10,15 @@ import { unxzFile, unzipFile } from "./downloadHelpers.mjs";
1010import { unknownErrorToString } from "./errorHelper.mjs" ;
1111import {
1212 EXT_USER_AGENT ,
13+ WINDOWS_ARM64_GIT_DOWNLOAD_URL ,
1314 WINDOWS_X86_GIT_DOWNLOAD_URL ,
1415} from "./sharedConstants.mjs" ;
1516
1617/**
1718 * Downloads and installs a portable version of Git.
1819 *
19- * Supports Windows x64 and macOS x64 + arm64.
20- * But currently only execution on Windows x64 is enabled.
20+ * Supports Windows x64 + arm64 and macOS x64 + arm64.
21+ * But currently only execution on Windows x64 and Windows arm64 is enabled.
2122 *
2223 * @returns The path to the installed Git executable or undefined if the installation failed
2324 */
@@ -26,7 +27,7 @@ export async function downloadGit(
2627) : Promise < string | undefined > {
2728 if (
2829 process . platform !== "win32" ||
29- ( process . platform === "win32 " && process . arch !== "x64 " )
30+ ( process . arch !== "x64 " && process . arch !== "arm64 " )
3031 ) {
3132 Logger . debug (
3233 LoggerSource . gitDownloader ,
@@ -51,8 +52,12 @@ export async function downloadGit(
5152 // Ensure the target directory exists
5253 await mkdir ( targetDirectory , { recursive : true } ) ;
5354
54- // select download url for platform()_arch()
55- const downloadUrl = redirectURL ?? WINDOWS_X86_GIT_DOWNLOAD_URL ;
55+ // select download url
56+ const downloadUrl =
57+ redirectURL ??
58+ ( process . arch === "arm64"
59+ ? WINDOWS_ARM64_GIT_DOWNLOAD_URL
60+ : WINDOWS_X86_GIT_DOWNLOAD_URL ) ;
5661
5762 const tmpBasePath = join ( tmpdir ( ) , "pico-sdk" ) ;
5863 await mkdir ( tmpBasePath , { recursive : true } ) ;
0 commit comments