Skip to content

Commit

Permalink
feat: support for darwin arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocorradini committed Feb 2, 2023
1 parent a7a2b1e commit 95286fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v2.1.0](https://github.com/gunar/shellcheck/releases/tag/v2.1.0) - 2023-02-02

### Added

- `darwin` (`arm64`) support via [Rosetta 2](https://support.apple.com/HT211861)

## [v2.0.0](https://github.com/gunar/shellcheck/releases/tag/v2.0.0) - 2023-01-31

### Added
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Downloads the most recent version of [koalaman](https://github.com/koalaman)'s [

## Installation

> **Warning**: Node.js version `>= 18.4.0 || >= 16.17.0` is required
```sh
npm install --save-dev shellcheck
```
Expand Down Expand Up @@ -60,11 +62,12 @@ await download({

> **Note**: [`Platform`](https://nodejs.org/api/process.html#processplatform) and [`Architecture`](https://nodejs.org/api/process.html#processarch) follow _Node.js_ naming convention
| **Platform** | **Architecture** |
| ------------ | ---------------- |
| **Platform** | **Architecture** | **Notes** |
| ------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `linux` | `arm64` |
| `linux` | `x64` |
| `darwin` | `x64` |
| `darwin` | `arm64` | [Rosetta 2](https://support.apple.com/HT211861) must be installed. There is no native binary for `darwin arm64` at the moment (see [this](https://github.com/koalaman/shellcheck/issues/2109)). As a result, the downloaded binary is for `x64`, and `Rosetta 2` translates it to operate with `Apple Silicon`. |
| `win32` | `x64` |

## Contributing
Expand Down
5 changes: 4 additions & 1 deletion src/configs/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export const config: Config = {
},
darwin: {
platform: 'darwin',
architectures: [['x64', 'x86_64']],
architectures: [
['x64', 'x86_64'],
['arm64', 'x86_64']
],
archive: 'tar.xz'
},
win32: { platform: '', architectures: [['x64', '']], archive: 'zip' }
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ARCHITECTURES_SUPPORTED: Record<
aix: [],
android: [],
cygwin: [],
darwin: ['x64'],
darwin: ['x64', 'arm64'],
freebsd: [],
haiku: [],
linux: ['arm64', 'x64'],
Expand Down

0 comments on commit 95286fc

Please sign in to comment.