Skip to content

Commit fb55d3c

Browse files
committed
fix: brew isn't supported on Linux arm
1 parent 29cd2e1 commit fb55d3c

File tree

8 files changed

+26
-14
lines changed

8 files changed

+26
-14
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,14 @@ Download the executable for your platform from [here](https://github.com/aminya/
7575
```shell
7676
# windows x64
7777
curl -o ./setup-cpp.exe -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.1.1/setup-cpp-x64-windows.exe"
78-
7978
# linux x64
8079
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.1.1/setup-cpp-x64-linux"
81-
chmod +x ./setup-cpp
82-
80+
# linux arm64
81+
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.1.1/setup-cpp-arm64-linux"
8382
# macos arm64
8483
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.1.1/setup-cpp-arm64-macos"
85-
chmod +x ./setup-cpp
86-
8784
# macos x64
8885
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.1.1/setup-cpp-x64-macos"
89-
chmod +x ./setup-cpp
9086
```
9187

9288
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
@@ -99,6 +95,7 @@ An example that installs llvm, cmake, ninja, ccache, and vcpkg:
9995

10096
```shell
10197
# linux/macos example
98+
chmod +x ./setup-cpp
10299
sudo ./setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
103100
source ~/.cpprc # activate cpp environment variables
104101
```

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-brew/__tests__/brew.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { setupBrew } from "../src/index.js"
77

88
jest.setTimeout(300000)
99
describe("setup-brew", () => {
10-
if (process.platform === "win32") {
10+
if (
11+
process.platform === "win32"
12+
|| process.platform === "linux" && process.arch !== "x64"
13+
) {
1114
it.skip("should setup brew", () => {})
1215
return
1316
}

packages/setup-brew/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-brew",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Setup brew and brew packages",
55
"repository": "https://github.com/aminya/setup-cpp",
66
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-brew",

packages/setup-brew/src/install.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { tmpdir } from "os"
22
import { dirname, join } from "path"
3+
import { warning } from "ci-log"
34
import { type AddPathOptions, addPath } from "envosman"
45
import { execaSync } from "execa"
56
import { DownloaderHelper } from "node-downloader-helper"
@@ -21,9 +22,20 @@ export type SetupBrewOptions = {
2122
arch?: never
2223
}
2324

25+
/**
26+
* Install brew
27+
*
28+
* @param options - Options for adding the brew path to the rc file
29+
* @returns The path to the bin directory of brew if brew is installed, otherwise undefined if brew is not supported on the current platform
30+
*/
2431
export async function setupBrew(options: SetupBrewOptions = {}): Promise<InstallationInfo | undefined> {
25-
// brew is only available on darwin and linux
26-
if (!["darwin", "linux"].includes(process.platform)) {
32+
if (
33+
// brew is only available on darwin and linux
34+
!["darwin", "linux"].includes(process.platform)
35+
// brew is only supported on Linux x64
36+
|| (process.platform === "linux" && process.arch !== "x64")
37+
) {
38+
warning(`Brew is not supported on ${process.platform} ${process.arch}`)
2739
return undefined
2840
}
2941

0 commit comments

Comments
 (0)