From 427250590160db21bcad6183b6ada5ba769354dd Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sat, 10 Oct 2020 00:14:09 +0800 Subject: [PATCH] fix: wrong condition in build command Close https://github.com/napi-rs/napi-rs/issues/219 --- src/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.ts b/src/build.ts index 2ff8fb38..ca4e124f 100644 --- a/src/build.ts +++ b/src/build.ts @@ -60,7 +60,7 @@ export class BuildCommand extends Command { throw new TypeError('Could not parse the Cargo.toml') } - if (tomlContent.package ?? tomlContent.package.name) { + if (tomlContent.package?.name) { dylibName = tomlContent.package.name.replace(/-/g, '_') } else { throw new TypeError('No package.name field in Cargo.toml')