fix(cli): should not throw if cargoName is provided but no package.name

This commit is contained in:
LongYinan 2022-04-01 17:07:53 +08:00
parent a88bc57ea3
commit 8700da1776
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
2 changed files with 9 additions and 0 deletions
cli/src

View file

@ -204,6 +204,8 @@ export class BuildCommand extends Command {
let cargoPackageName: string
if (tomlContent.package?.name) {
cargoPackageName = tomlContent.package.name
} else if (this.cargoName) {
cargoPackageName = this.cargoName
} else {
throw new TypeError('No package.name field in Cargo.toml')
}