Merge pull request #221 from napi-rs/fix-build-condition

fix: wrong condition in build command
This commit is contained in:
LongYinan 2020-10-10 00:37:49 +08:00 committed by GitHub
commit afa6c075ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')