Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 9c40a23

Browse files
authored
add $ARCH to install script (#154)
* add $ARCH to install script * refactor
1 parent 507f623 commit 9c40a23

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/bacalhau.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ import execa from 'execa'
33
import { fetch } from 'undici'
44
import Sentry from '@sentry/node'
55
import { installBinaryModule, getBinaryModuleExecutable } from './modules.js'
6+
import os from 'node:os'
67

78
const DIST_TAG = 'v1.0.3'
9+
const { TARGET_ARCH = os.arch() } = process.env
810

911
export async function install () {
1012
await installBinaryModule({
1113
module: 'bacalhau',
1214
repo: 'bacalhau-project/bacalhau',
1315
executable: 'bacalhau',
1416
distTag: DIST_TAG,
17+
arch: TARGET_ARCH,
1518
targets: [
1619
{ platform: 'darwin', arch: 'x64', asset: `bacalhau_${DIST_TAG}_darwin_amd64.tar.gz` },
1720
{ platform: 'darwin', arch: 'arm64', asset: `bacalhau_${DIST_TAG}_darwin_arm64.tar.gz` },

lib/modules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const installBinaryModule = async ({
3636
repo,
3737
distTag,
3838
executable,
39-
arch = os.arch(),
40-
targets
39+
targets,
40+
arch
4141
}) => {
4242
console.log(
4343
`[${module}] GitHub client: ${authorization ? 'authorized' : 'anonymous'}`

lib/zinnia.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import execa from 'execa'
33
import Sentry from '@sentry/node'
44
import { installBinaryModule, downloadSourceFiles, getBinaryModuleExecutable } from './modules.js'
55
import { moduleBinaries } from './paths.js'
6+
import os from 'node:os'
67

78
const ZINNIA_DIST_TAG = 'v0.10.1'
89
const ZINNIA_MODULES = [
@@ -12,6 +13,7 @@ const ZINNIA_MODULES = [
1213
distTag: 'v0.1.1'
1314
}
1415
]
16+
const { TARGET_ARCH = os.arch() } = process.env
1517

1618
export async function install () {
1719
await Promise.all([
@@ -20,6 +22,7 @@ export async function install () {
2022
repo: 'filecoin-station/zinnia',
2123
distTag: ZINNIA_DIST_TAG,
2224
executable: 'zinniad',
25+
arch: TARGET_ARCH,
2326
targets: [
2427
{ platform: 'darwin', arch: 'arm64', asset: 'zinniad-macos-arm64.zip' },
2528
{ platform: 'darwin', arch: 'x64', asset: 'zinniad-macos-x64.zip' },

0 commit comments

Comments
 (0)