Skip to content

Commit fe1bb06

Browse files
authored
Merge pull request #234 from raspberrypi/update-git
2 parents d975f43 + 907da18 commit fe1bb06

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/utils/downloadGit.mts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ import { unxzFile, unzipFile } from "./downloadHelpers.mjs";
1010
import { unknownErrorToString } from "./errorHelper.mjs";
1111
import {
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 });

src/utils/sharedConstants.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export const OPENOCD_VERSION = "0.12.0+dev";
99

1010
export const WINDOWS_X86_GIT_DOWNLOAD_URL =
1111
"https://github.com/git-for-windows/git/releases/download" +
12-
"/v2.51.0.windows.2/MinGit-2.51.0.2-64-bit.zip";
12+
"/v2.51.2.windows.1/MinGit-2.51.2-64-bit.zip";
13+
export const WINDOWS_ARM64_GIT_DOWNLOAD_URL =
14+
"https://github.com/git-for-windows/git/releases/download" +
15+
"/v2.51.2.windows.1/MinGit-2.51.2-arm64.zip";
1316

1417
export const EXAMPLES_REPOSITORY_URL =
1518
"https://github.com/raspberrypi/pico-examples.git";

0 commit comments

Comments
 (0)