From dc1069203f01d1dbd0f228eff5a13a6186bc5343 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 9 Dec 2020 15:49:05 +0800 Subject: [PATCH] fix(cli): regard to target platform, not current platform --- cli/package.json | 2 +- cli/src/build.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/package.json b/cli/package.json index 4e0b46c9..34a99bea 100644 --- a/cli/package.json +++ b/cli/package.json @@ -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 ", diff --git a/cli/src/build.ts b/cli/src/build.ts index 4198316c..8dec9f2d 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -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'