fix(cli): regard to target platform, not current platform

This commit is contained in:
LongYinan 2020-12-09 15:49:05 +08:00
parent 7f2c92fa79
commit dc1069203f
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@napi-rs/cli",
"version": "1.0.0-alpha.9",
"version": "1.0.0-alpha.10",
"description": "Cli tools for napi-rs",
"keywords": ["cli", "rust", "napi", "n-api", "neon"],
"author": "LongYinan <lynweklm@gmail.com>",

View file

@ -1,5 +1,4 @@
import { execSync } from 'child_process'
import os from 'os'
import { join, parse, sep } from 'path'
import chalk from 'chalk'
@ -104,7 +103,7 @@ export class BuildCommand extends Command {
debug(`Dylib name: ${chalk.greenBright(dylibName)}`)
const platform = os.platform()
const platform = triple.platform
let libExt
debug(`Platform: ${chalk.greenBright(platform)}`)
@ -121,6 +120,7 @@ export class BuildCommand extends Command {
case 'linux':
case 'freebsd':
case 'openbsd':
case 'android':
case 'sunos':
dylibName = `lib${dylibName}`
libExt = '.so'