Skip to content

Commit

Permalink
add macOS arm64 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jansedivy committed May 11, 2023
1 parent 7bf1c0e commit 51efb43
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FLOW_BINS = \
flow-linux64-v$(FLOW_VERSION)/flow \
flow-linux-arm64-v$(FLOW_VERSION)/flow \
flow-osx-v$(FLOW_VERSION)/flow \
flow-osx-arm64-v$(FLOW_VERSION)/flow \
flow-win64-v$(FLOW_VERSION)/flow.exe

.PHONY: all
Expand Down Expand Up @@ -66,6 +67,9 @@ flow-linux-arm64-v%/flow:
flow-osx-v%/flow:
$(get-flow)

flow-osx-arm64-v%/flow:
$(get-flow)

flow-win64-v%/flow.exe:
$(get-flow)

Expand Down
1 change: 1 addition & 0 deletions SHASUM256.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
8be245e57445e7b3f7f8a4c7dfc8d06d2b493b1654f6cb2791af3a78d088828b flow-linux64-v0.206.0/flow
83854daff1a8911439314207bcba6fec5dbac80891186642b4ba2783340970d5 flow-linux-arm64-v0.206.0/flow
940b921b5b23e61c0af339623572f7e8f31de7123ff994c9b02b69a8329f31f3 flow-osx-v0.206.0/flow
f994baa69f16fc729eb990e2c80c87b9de39841fecf801ddf49f5dd232a15990 flow-osx-arm64-v0.206.0/flow
67cf09d2b7b9bddbb39d9d6264f6085952e7c836cb4e8b8733d46eede7cef858 flow-win64-v0.206.0/flow.exe
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ var VERSION = require('./package.json').version;
var path = require('path');

module.exports =
process.platform === 'darwin'
process.platform === 'darwin' && process.arch === 'x64'
? path.join(__dirname, 'flow-osx-v' + VERSION, 'flow') :
process.platform === 'darwin' && process.arch === 'arm64'
? path.join(__dirname, 'flow-osx-arm64-v' + VERSION, 'flow') :
process.platform === 'linux' && process.arch === 'x64'
? path.join(__dirname, 'flow-linux64-v' + VERSION, 'flow') :
process.platform === 'linux' && process.arch === 'arm64'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"flow-linux64-v*/flow",
"flow-linux-arm64-v*/flow",
"flow-osx-v*/flow",
"flow-osx-arm64-v*/flow",
"flow-win64-v*/flow.exe",
"vendor",
"cli.js",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Binary wrapper for [Flow](https://flow.org) - A static type checker for JavaScript
macOS (x64), Linux (x64, arm64) and Windows (x64) binaries are currently [provided](https://flow.org/en/docs/install/).
macOS (x64, arm64), Linux (x64, arm64) and Windows (x64) binaries are currently [provided](https://flow.org/en/docs/install/).


## CLI
Expand Down
9 changes: 8 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
*/
var fs = require('fs');

// osx
// osx x64
process.platform = 'darwin';
process.arch = 'x64'
delete require.cache[require.resolve('./')];
fs.statSync(require('./'));

// osx arm64
process.platform = 'darwin';
process.arch = 'arm64'
delete require.cache[require.resolve('./')];
fs.statSync(require('./'));

Expand Down

0 comments on commit 51efb43

Please sign in to comment.