Skip to content

Commit

Permalink
feature(fetch-engine/getplatform): detect free/open/net bsd and show …
Browse files Browse the repository at this point in the history
…a warning for binaries
  • Loading branch information
Jolg42 committed Apr 24, 2020
1 parent ea556f4 commit 2574dfd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/packages/fetch-engine/src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export async function download(options: DownloadOptions): Promise<BinaryPaths> {
'Warning',
)} Precompiled binaries are not available for ARM.`,
)
} else if (['freebsd', 'openbsd', 'netbsd'].includes(platform)) {
console.error(
`${chalk.yellow(
'Warning',
)} Precompiled binaries are not available for ${platform}.`,
)
}

// no need to do anything, if there are no binaries
Expand Down
12 changes: 12 additions & 0 deletions src/packages/get-platform/src/getPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ export async function getPlatform(): Promise<Platform> {
return 'windows'
}

if (platform === 'freebsd') {
return 'freebsd'
}

if (platform === 'openbsd') {
return 'openbsd'
}

if (platform === 'netbsd') {
return 'netbsd'
}

// when the platform is linux
if (platform === 'linux' && distro && libssl) {
return (distro + '-openssl-' + libssl) as Platform
Expand Down
3 changes: 3 additions & 0 deletions src/packages/get-platform/src/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export type Platform =
| 'rhel-openssl-1.0.x'
| 'rhel-openssl-1.1.x'
| 'windows'
| 'freebsd'
| 'openbsd'
| 'netbsd'

export const platforms = [
'darwin',
Expand Down

0 comments on commit 2574dfd

Please sign in to comment.