Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit f0cf7d8

Browse files
authoredSep 7, 2022
fix: use os.arch() when arch is undefined (#488)
fixes #487
1 parent 2288d77 commit f0cf7d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎scripts/setup-libp2p-relay-daemon.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ async function getDownloadURL (version, platform, arch, distUrl) {
7777
const data = await got(`${distUrl}/libp2p-relay-daemon/${version}/dist.json`).json()
7878

7979
if (!data.platforms[platform]) {
80-
throw new Error(`No binary available for platform '${platform}'`)
80+
throw new Error(`No binary available for platform '${platform}'. Available platforms: ${Object.keys(data.platforms).join(', ')}`)
8181
}
8282

8383
if (!data.platforms[platform].archs[arch]) {
84-
throw new Error(`No binary available for platform '${platform}' and arch '${arch}'`)
84+
throw new Error(`No binary available for platform '${platform}' and arch '${arch}'. Available architectures: ${Object.keys(data.platforms[platform].archs)}`)
8585
}
8686

8787
const link = data.platforms[platform].archs[arch].link
@@ -148,8 +148,8 @@ async function download ({ version, platform, arch, installPath, distUrl }) {
148148

149149
download({
150150
version: LIBP2P_RELAY_DAEMON_VERSION,
151-
platform: process.env.TARGET_OS || goenv.GOOS,
152-
arch: process.env.TARGET_ARCH || goenv.GOARCH,
151+
platform: process.env.TARGET_OS || goenv.GOOS || os.platform(),
152+
arch: process.env.TARGET_ARCH || goenv.GOARCH || os.arch(),
153153
distUrl: process.env.GO_IPFS_DIST_URL || 'https://dist.ipfs.io',
154154
installPath: path.resolve('scripts')
155155
})

0 commit comments

Comments
 (0)
This repository has been archived.