fix: wrong condition in build command

Close https://github.com/napi-rs/napi-rs/issues/219
This commit is contained in:
LongYinan 2020-10-10 00:14:09 +08:00
parent dca2bb322e
commit 4272505901
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -60,7 +60,7 @@ export class BuildCommand extends Command {
throw new TypeError('Could not parse the Cargo.toml') 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, '_') dylibName = tomlContent.package.name.replace(/-/g, '_')
} else { } else {
throw new TypeError('No package.name field in Cargo.toml') throw new TypeError('No package.name field in Cargo.toml')